Java String length example

String’s length method is used to calculate length of String. It returns number of character in the String.

Method Signature:

String length Example:

When you run above program, you will get below output:

Was this post helpful?

Leave a Reply

Your email address will not be published. Required fields are marked *