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
Explain the difference between map and flatmap stream operation?
What is the syntax and characteristics of a lambda expression?
What is unsigned char?
How does java pattern compile work?
What are encapsulation, inheritance and polymorphism?
What happens if we don’t override run method ?
what is static import in java? Explain
Is java still relevant?
Which container method is used to cause a container to be laid out and redisplayed in java programming?
Which is bigger float or double java?
What is the difference between static binding and dynamic binding?
What is the difference between comparison done by equals method and == operator?
What is oop in java?
What is the null?
Is this valid in java ? Can we instantiate interface in java?