Which three are valid?

Given:
1. interface Pet { }
2. class Dog implements Pet { }
3. class Beagle extends Dog { }
Which three are valid? (Choose three.)

Given:
1. interface Pet { }
2. class Dog implements Pet { }
3. class Beagle extends Dog { }
Which three are valid? (Choose three.)

A.
Pet a = new Dog();

B.
Dog d = new Beagle();

C.
Dog f = new Pet();

D.
Beagle c = new Dog();

E.
Pet e = new Beagle();

F.
Pet b = new Pet();



Leave a Reply 1

Your email address will not be published. Required fields are marked *


Kurt

Kurt

The correct answer is ADE