import java.util.*;
public class Arrays1 {
  public static void main(String[] args) {
    Random r = new Random();
    int[] nums = new int[10];
    for (int i = 0; i < nums.length; i++) {
      nums[i] = r.nextInt(100);
    }
    System.out.println("Item at index 7 is: " + nums[7]);
    String[] names = new String[3];
    names[0] = "Joe";   // first item
    names[1] = "Jane";  // second item
    names[2] = "Herkimer";  // third and final item
    for (int i = 0; i < names.length; i++) {
      System.out.println(names[i]);
    }
    //this line will throw an exception because index "3" attempts to access the fourth item
    System.out.println(names[3]);
  }
}