Java Program to Calculate Length of String

Here is a simple java program to calculate Length of a string….

import java.lang.String;
class lengthofstring
{
    public static void main(String a)
    {
        int len1=a.length();
        System.out.println(“Word :”+a);
        System.out.println(“The Length of the String :”+len1);
    }
}

Add Comment