Problem: CharAt and String

Create a program that will display the first letter of a string as well as display the string's length. Note that the string will not be provided by the user.

class s30
{
public static void main (String args[])
{
String a = "Hello World";
char s = a.charAt(0);
System.out.println(s);
System.out.println(a.length());
}
}

No comments:

Post a Comment

Extended Search

Custom Search
Hello World