length - Returns the length of the string. in Java

String: To store the Contents to use in the program.
length(): To find the total charcter in the given string.
Syntax:
AccessModifier int VariableName =StringVariable.length();
Example: 
public String a="forgercode";
int b=a.length();

import java.lang.*;
class ForgetCode
{
public static void main(String args[])
{
String forget="www.forgetcode.com";
System.out.println("A Syntax warehouse site:"+forget);
int a=forget.length();
System.out.println("Length of the string:"+a);
}
}