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.
Recommend the tutorial