Answer Posted / subhash
No.We cannot create instance for interface.But we can
create reference to an interface.We can implement the
interface by creating sub class(implementation class) and
creat instance to the sub class, then you can create
reference to the interface by assigning instance of sub
class to the interface reference variable.
| Is This Answer Correct ? | 8 Yes | 0 No |
Post New Answer View All Answers
Can we instantiate interface in java?
Can java program run without jre?
I want my class to be developed in such a way that no other class (even derived class) can create its objects. Define how can I do so?
What does exclamation mean in java?
What steps are taken when the OS shifts from one-thread execution to another?
Can singleton class be inherited in java?
What is final modifier?
Explain the Propertie sof class?
What is keyset in java?
What is final, finally, finalize?
What variables are stored in stack?
Explain about collection interface in java?
What is a parent class in java?
What are different types of multitasking?
What is an object class?