What is the output the program shown below. interface A { } class D extends C { } class C { } class B extends D implements A { } public class Quiz2F { public static void main(String[] args) {
What is the output the program shown below.
interface A
{
}
class D extends C
{
}
class C
{
}
class B extends D implements A
{
}
public class Quiz2F
{
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”);
}
}
options:
| b is an instance of C |
| b is an instance of A followed by b is an instance of C |
| Nothing |
| b is an instance of A |