2-21 StringLength
Post date: Jan 23, 2014 11:23:32 AM
// This program demonstrates the String class's length method.
package stringlength;
public class StringLength
{
public static void main(String[] args)
{
String name = "Herman";
int stringSize;
stringSize = name.length();
System.out.println(name + " has " + stringSize + " characters.");
}
}