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 | 35 | 9 | 4 | 12 | 2 | 15 | 10 | 8 | 14 |
Use selection sort to sort the array. Show the array after each swap is made.