HELP! * YELLOW=global GREY=local Global HTML version of Foils prepared 4 February 97

Foil 37 More on Strings, and the StringBuffer class

From Feb 3 Delivered Lecture for Course CPS616 -- Java Lecture 4 -- AWT Through I/O CPS616 spring 1997 -- Feb 3 1997. by Nancy McCracken * See also color IMAGE
Secs 44.6
String comparison can be done with the methods equals and equalsIgnoreCase. Note that == tests if two strings are the same string instance, while equals tests if two different strings have the same characters.
Other methods include length, CharAt and toString.
The StringBuffer class has mutable strings, but is created with a fixed maximum size. It has methods such as append to extend the length of the string.


Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Sun Feb 16 1997