What is the best way of concatenating strings found in an array of length n?
you should be using ArrayLists, and your output should be an ArrayList. Once you've made these your pre-condition, the operation is built-in--first.addAll(second). The only case where this wouldn't be pretty much automatic is when your arrays are non-object types (int, long, double, ...), in that case, intrinsic arrays can have a big advantage over ArrayLists--but for Strings
String ccyPair = ccy1 + ccy2; I\'m utilizing cyPair as a key in a HashMap and it\'s brought in a tight circle to recover esteems. When I profile then this is the bottleneck java.lang.StringBuilder.append(StringBuilder.java:119) java.lang.StringBuilder.(StringBuilder.java:93)
Get an answer in 5 minutes from expert tutors at Oxford, Cambridge, Imperial and more.