a) String[] names; System.out.println(names[0]); b) String[] names; names = new String[10]; System.out.println(names[5]); c) String[] names; names = new String[10]; System.out.println(names[5].length()); d) String[] names; names = new String[10]; for (int i=0; i<10; i++) names[i] = "joe" + i; System.out.println(names[5]); e) String[] names; names = new String[10]; for (int i=0; i<10; i++) names[i] = "joe" + i; System.out.println(names[5].length());
5 | 8 | 9 | 11 | 12 | 14 | 15 | 20 | 22 | 25 |
Use binary search to search for values