Question 62 of 76 from exam 1Z0-808: Java SE 8 Programmer I

Question 62 of 76 from exam 1Z0-808: Java SE 8 Programmer I

Question

Given the following class declarations: -> public abstract class Animal -> public interface Hunter -> public class Cat extends Animal implements Hunter -> public class Tiger extends Cat Which answer fails to compile?

A) ArrayList<Animal> myList
myList.add(new Tiger ());

new ArrayList<>();

B) ArrayList<Hunter> myList
myList.add(new Cat ());

new ArrayList<>();

C) ArrayList<Hunter> myList = new ArrayList<>();
myList.add(new Tiger ()) i

D) ArrayList<Tiger> myList = new ArrayList<>();
myList.add(new Cat ());

E) ArrayList<Animal> myList = new ArrayLIst<>();
myList.add(new Cat ());

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D. E.

E.