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 string :: npos?
Is upper case in java?
Is integer immutable in java?
How can you make sure that your singleton class will always return single instance in multi-threaded environment?
what is ststic with example
What is polymorphism and what are the types of it?
Can we override constructors in java?
What data type is true or false?
How to store image in arraylist in java?
Can inner class final?
What class allows you to read objects directly from a stream?
Can we catch more than one exception in single catch block?
What are parameters in a method?
Is string a class?
What is a website container?