Optimize the split of a String from console I have to read a String from console, so I used the tokenizer to split it and add each token in a position on arrayList, is there a way to improve the operation of split?

while ((currentLine = bufferedReader.readLine()) != null ) {
            StringTokenizer string = new StringTokenizer(currentLine, " ");
            while (string.hasMoreTokens()) {
            arrayList.add(string.nextToken());
            }
}
This is probably not your bottleneck, but you could achieve the same result by:

ditching the StringTokenizer in favour of String.split()
replacing the while loop with a call to Collections.addAll(T...)

Like so:
while ((currentLine = bufferedReader.readLine()) != null) {
    Collections.addAll(arrayList, currentLine.split(&quot; &quot;)));
}

The static method Collections.addAll() is preferable to arrayList.addAll(Arrays.asList()):

public static &lt;T&gt; boolean addAll(Collection&lt;? super T&gt; c, T... elements)
Adds all of the specified elements to the specified collection. Elements to be added may be specified individually or as an array. The behavior of this convenience method is identical to that of c.addAll(Arrays.asList(elements)), but this method is likely to run significantly faster under most implementations.