length() is the Java String class method that returns the actual length of the String. The length() method will always returns integer value for any given String for example...
String str = "mylength";
int length = str.length();
System.out.println("String Length is : " + length);
the output is:
String Length is : 8
Java length method is specified in CharSequence interface and it always return the length of the characters represented by this object.
Posted on: March 27, 2005 If you enjoyed this post then why not add us on Google+? Add us to your Circles