/** the Strings class introduces us to the data type used for text. */ /* def of a string is a sequence of characters */ import java.util.Scanner; public class Strings { public static void main(String[] args) { String name1 = "John Doe"; System.out.println("name1 is " + name1); String name2 = "Alice"; System.out.println("name2 is " + name2); if (name1.length() != name2.length()) System.out.println("length of name2 is: " + name2.length()); System.out.println("name2's first initial is: " + name2.charAt(0)); int i; Scanner sc = new Scanner(System.in); System.out.print("enter an index: "); i = sc.nextInt(); sc.nextLine(); // skip newline if (i >= 0 && i