public class String4 { public static void main ( String [] args ) { String str1 = "Hello!"; int len = str1.length(); //len == 6 System.out.println ( len ); String str2 = "Hello!"; char ch = str2.charAt(4); // ch == 'o' System.out.println ( ch ); String str3 = "Hi World!"; int m = str3.indexOf("World"); // m == 3 int n = str3.indexOf("Sun"); // n == -1 System.out.println ( m + " " + n ); String str4 = "Hello World!"; int x = str4.indexOf('l', 5); // x == 9 int y = str4.indexOf('l'); // y == 2 System.out.println ( x + " " + y ); } }