PPT Slide
3. Several predefined methods provided
in built-in class String.
length( ) // a string knows its length charAt(iIndex) // returns letter at position
iIndex; 1st char is position 0
substring(iStartIndex) // returns the
// substring from position
// iStartIndex to end of string
substring(iStartIndex, iEndIndex) // returns
// substring from position iStartIndex
// until but NOT INCLUDING position iEndIndex
1. You need not explicitly instantiate Strings.
2. The ‘+’ operater overloaded for Strings, to support concatenation, e.g.,
System.out.println(“This string is an example of” +
“ one that is too long to fit on one line. Your TAs take off points” +
“ for lines that exceed 80 column characters.”);