Question 4
A university wants to store information about its courses. For each course it tracks the course name, course code, number of credits, and whether it is a lecture or lab. Lecture courses track the classroom size. Lab courses track the equipment list.
Which of the following is the best object-oriented design?
Question 10
Consider the following code segment.
List<Integer> list = new ArrayList<Integer>();
list.add(new Integer(10));
list.add(new Integer(20));
list.add(1, new Integer(15));
list.add(0, new Integer(5));
list.add(new Integer(25));
list.set(3, new Integer(18));
list.add(2, new Integer(12));
System.out.println(list);
What is printed as a result of executing this code segment?