Answer Posted / anil pusuluri
One can't instantiate an interface. One can get a reference
to an interface.
Let's say Class A implements interface iA then we can't
instantiate IA
like IA a = new IA() -- this gives compilation error.
but we can get the referance to interface as below
IA a = new A()
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is hashset in java?
Can java program run without jre?
List implementations of list interface?
Why string is called as immutable?
How do you define a parameter?
What is the difference between the paint() and repaint() methods?
What is the latest java version?
What is the use of list in java?
Why are variables important in research?
What is the full form of jpeg?
Why are constructors used?
Explain the difference between association, aggregation and inheritance relationships.
What is an example of a keyword?
Can we have multiple catch block for a try block?
What is class level lock ?