Java Programming Language MCQ Java Interfaces And Abstract Classes MCQ
⚠ Report ✓ Question Verified Copy Link
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"); } }
Learn More MCQ Questions from Java Programming Language MCQ Java Interfaces And Abstract Classes MCQ