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