Question: Question 1 (3 marks): Are there any compile errors in (a) and (b)? Briefly explain your answer ArrayList dates - new ArrayList(); dates.add(new Date()); dates.add(new

 Question 1 (3 marks): Are there any compile errors in (a)

Question 1 (3 marks): Are there any compile errors in (a) and (b)? Briefly explain your answer ArrayList dates - new ArrayList(); dates.add(new Date()); dates.add(new string(); ArrayList dates - new ArrayList(); dates.add(new Date()); dates.add(new String(); (a) (b) Question 2 (10 marks): Suppose that setl (Set) is a set that contains the strings "red", "yellow", "green", and that set2 (Set) is another set that contains the strings "red", "yellow", "blue". Answer the following questions: (All the questions are independent) 1. What is set1 after executing set1.addAll(set2)? 2. What is set1 after executing set1.add(set2)? 3. What is set1 after executing set 1.removeAll(set2)? 4. What is set1 after executing set 1.remove(set2)? 5. What is set1 after executing set1.retainAll(set2)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!