Javatpoint Logo
Javatpoint Logo

Java String length()

The java string length() method length of the string. It returns count of total number of characters. The length of java string is same as the unicode code units of the string.

Internal implementation


The signature of the string length() method is given below:

Specified by

CharSequence interface


length of characters

Java String length() method example

Test it Now
string length is: 10
string length is: 6

Java String length() Method Example 2

String is not empty and length is: 10
String is empty now: 0

Youtube For Videos Join Our Youtube Channel: Join Now

Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Trending Technologies

B.Tech / MCA