Multiple Choice Question

Quiz Guidelines



Given the following class definitions :

interface MyIface{};
class A {};
class B extends A implements MyIface{};
class C implements MyIface{};

and the following object instantiations:

A a = new A();
B b = new B();
C c = new C();

Which of the following assignments are legal at compile time?

Select 1 option

A. b = c;
B. c = b; 
C. MyIface i = c; 
D. c = (C) b; 
E. b = a;

Q&A Set: