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
Can we use catch statement for checked exceptions?
What is the lifetime and scope of a variable?
What is the benefit of using enum to declare a constant?
Explain OOPs concept.
What is difference between synchronize and concurrent collection in java?
What are the two categories of data types in the java programming language?
What are the differences between this and super keyword?
What does substring mean?
What is the major drawback of internal iteration over external iteration?
List down the methods and interfaces of collection class in java.
What is java instanceof operator?
What classes of exceptions may be thrown by a throw statement?
What is meant by object?
When should I use a singleton?
What is the most important feature of java? What is an interface?