public class QuickBrownFoxExample
{
public static void main(String args[])
{
// QuickBrownFoxExample
String str1 = "The quick brown fox";
String str2 = "jumped over";
String str3 = "the lazy dogs.";
int len = str1.length();
System.out.println("Length of '" + str1 + "' is " + len);
len = str2.length();
System.out.println("Length of '" + str2 + "' is " + len);
len = str3.length();
System.out.println("Length of '" + str3 + "' is " + len);
}
}
Length of 'The quick brown fox' is 19 Length of 'jumped over' is 11 Length of 'the lazy dogs.' is 14
--- Output Ends ---
- javac QuickBrownFoxExample.java
- java QuickBrownFoxExample