MCQ
Single Best Answer
Not Set
QDetermine output of the following code.
interface A { }
class C { }
class D extends C { }
class B extends D implements A { }
public class Test extends Thread{
public static void main(String[] args){
B b = new B();
if (b instanceof A)
System.out.println("b is an instance of A");
if (b instanceof C)
System.out.println("b is an instance of C");
}
}
ID: #2277
Java Interfaces And Abstract Classes MCQ
2,533 views
Question Info
#2277Q ID
Not SetDifficulty
Java Interfaces And Abstract Classes MCQTopic
Your Answer
Choose the Best Option
Click any option to instantly check if you're correct.
Correct Answer: Option D
Explanation
b is an instance of A followed by b is an instance of C.
Continue Practice
Share
Share This Question
Challenge a friend or share with your study group.
More from This Topic