Advertisements
Advertisements
Question
Describe the purpose of the following function with its syntax:
length()
Code Writing
Solution
The purpose of this function is to return a String's length. (The characters' number). An integer value is the result.
Example:
String d = "Simpleton";
System.out.println(d.length());
Output: 9
shaalaa.com
Is there an error in this question or solution?
Chapter 4: String Handling - EXERCISES [Page 289]