CS202 Java-125
Additional String Methods
l
Method
length
returns an
int
value that
is the number of characters in the string
l
String name = “Donald Duck”;
l
numChars;
l
numChars = name.length();
l
l
instance
method
l
length is an instance method
l