JDK 1.1 for Solaris Developer's Guide


When using strings, the most important thing to remember is to use char arrays for all character processing in loops, instead of using the String or StringBuffer classes. Accessing an array element is much faster than using the charAt() method to access a character in a string. Also, remember that string constants ("...") are already string objects.


String s = new String("hello");


String s = "hello";

In addition: