The String length() method returns the number of characters in a specified string. The general form of this length() method is as follows:
For example, a String is given as follows:
Now to obtain the number of characters in str, use the length() method:
It will return 5, as this is the number of characters in str.
Download practice question and study guide for scja for exam. Pass SUN CX310-019 - SCJA