Using String[ : 10] in Java mode

I started learning processing.py and found a String[int] function (String.charAt( ) ) and String[ : int ] which returns the string before int.

Can I do something similar to it in Java mode (normal processing) without using

String input = "hello", newString = "";
for(int i = 0; i < num; i++) {
   newString += input.charAt(i);
}

?

The [:4] function is just so useful

See the metods in this tutorial.