English

Describe the purpose of the following function with its syntax: length() - Computer Applications

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:

shaalaa.com
  Is there an error in this question or solution?
Chapter 4: String Handling - EXERCISES [Page 289]

APPEARS IN

Avichal Computer Applications [English] Class 10 ICSE
Chapter 4 String Handling
EXERCISES | Q VIII. 4. | Page 289
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×