
import java.util.ArrayList;

class Questions {
	public static void main(String[] args) {

        /* Create 2 instances of Car and insert into ArrayList of Cars
            then print the contents of the list to the screen */

		Car c = new Car("abc123", "ford", "fusion");
		System.out.println(c.getVIN());
		System.out.println(c.make);
		System.out.println(c.model);

		Car c2 = new Car("def456", "toyota", "tacoma");

		ArrayList<Car> carList = new ArrayList<>();
		carList.add(c);
		carList.add(c2);

		System.out.println("* Print all cars in list");
		for(Car car : carList) {
		    System.out.printf("%s, %s, %s\n", car.getVIN(), car.make, car.model);
		}

        /* Create an ArrayList of Strings, populate the list,
            then print the contents of the list */
	
		ArrayList<String> list = new ArrayList<>();
	
		list.add("Foo");
		list.add("Fighters");

		System.out.println("* Print all strings in list");
		for(String str : list) {
			System.out.println(str);
		}

		/* Create a variable that holds the Fri instance of the Day class */
		Day today = Day.Fri;
		System.out.println(today);

        /* Get all of the named instances of the Day class and print them
            to the screen */

		Day[] days = Day.values();

        System.out.println("* Print all named instances in the Day class");
		for(Day d : days) {
			System.out.println(d);
		}

        /* Use the enumerated class' valueOf method to get a named instance using
            a string. */

		Day tomorrow = Day.valueOf("Sat");
		System.out.println(tomorrow);

        /* Create an ArrayList of Integers, populate the list and print the
            integers to the screen.  We show how we can add an instance of the
            Integer class as well as use Java's autoboxing with a primitive to
            create an instance of the Integer class for insertion into the
            ArrayList. */

		ArrayList<Integer> list2 = new ArrayList<>();
		//Integer first = new Integer(73);              // deprecated
		Integer first = Integer.valueOf(73);
		list2.add(first);
		list2.add(27); // autoboxing  - must call valueOf() to retrieve instance of Integer class

		System.out.println("* Print integers in the list");
		for(Integer i : list2) {
		    System.out.println(i);
		}
	}
}
