package class2_1_Strings; // Josiah Yoder, MSOE, 14 September 2015 import java.util.Scanner; public class UsingStrings { public static void main(String[] args) { Scanner in = new Scanner(System.in); String name = "Josiah"; char initial = name.charAt(0); System.out.println("Initial: "+initial); int length = name.length(); System.out.println("Length: "+length); String start = name.substring(0, 2); System.out.println("Start: "+start); String middle = name.substring(2,4); System.out.println("Middle: "+middle); String end = name.substring(4,6); System.out.println("End: "+end); // int x = 1; // System.out.println("x == 1: " + (x == 1)); // System.out.println("end == \"ah\": "+ end == "ah"); } }