Write a program to find length of a string

Method to find length of string: String.length();

public static void main(String[] args) {
        String sentence="Hello Java";
        int count=sentence.length();
        System.out.println(count);
    }
Output: 10
about author

admin

salmansrabon@gmail.com

If you like my post or If you have any queries, do not hesitate to leave a comment.

Leave a Reply

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