Multiple Choice Question

Quiz Guidelines

 

QID: 
215
Question: 

Consider the following classes :

interface I{
}
class A implements I{
}
class B extends A {
}
class C extends B{
}

And the following declarations:

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

Identify options that will compile and run without error.

Select 1 option

A. a = (B)(I)b;
B. b = (B)(I) a;
C. a = (I) b;
D. I i = (C) a;

Q&A Set: 

Search the Web

Custom Search

Searches whole web. Use the search in the right sidebar to search only within javajee.com!!!