Menu
Question Index
...

interface IA
{
    void printA();
}

class A implements IA
{
    public void printA()
    {
        System.out.println("A's implementation of printA method.");
    }
}
Given interface IA and class A, which of the following is/are invalid statement(s)?

1. IA ia = new A();
ia.printA();
2. A a1 = new A();
IA ia = a1;
3. IA ia2 = new IA();


1
2
3
2 and 3
1 and 3

Doubts

Problems

Topic: Creating Interface In Java With Example Program

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App