Which of the following declarations are valid? class Base { ... } interface Spec
ID: 641594 • Letter: W
Question
Which of the following declarations are valid?
class Base
{
...
}
interface Spec
{
...
}
class Derived extends Base implements Spec
{
}
Question 15 options:
Derived object2 = new Base();
Spec object3 = new Derived();
Spec object4 = new Base();
Derived object5 = new Spec();
Which of the following expressions evaluates to false?
class C1 {}
class C2 extends C1 { }
class C3 extends C2 { }
class C4 extends C1 {}
C1 c1 = new C1();
C1 c2 = new C2();
C1 c3 = new C3();
C1 c4 = new C4();
c1 instanceof C1
c2 instanceof C1
c4 instanceof C2
c3 instanceof C1
Derived object2 = new Base();
Spec object3 = new Derived();
Spec object4 = new Base();
Derived object5 = new Spec();
Which of the following expressions evaluates to false?
class C1 {}
class C2 extends C1 { }
class C3 extends C2 { }
class C4 extends C1 {}
C1 c1 = new C1();
C1 c2 = new C2();
C1 c3 = new C3();
C1 c4 = new C4();
c1 instanceof C1
c2 instanceof C1
c4 instanceof C2
c3 instanceof C1
Explanation / Answer
C1 c4 = new C4();
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.