can you create interface instance ?
Answer Posted / kishore emani
Hi Anil, In this case uday sounds good!
As per your consideration if it is an anonymous class then
just remove that interface from our application and try to
compile it won't compile that code.
Here Test is an interface, for which to create the object
we need to provide the complete implementation for that
interface the same thing which uday did.
and again u check it if(t instanceof Test)
it is returning true that means t is an instance for Test.
and here the object is creating in the heap.
at finally here an instance is created for an interface.
| Is This Answer Correct ? | 4 Yes | 7 No |
Post New Answer View All Answers
Explain the available thread states in a high-level?
What is the difference between actual and formal parameters?
if u open login & logout ,how can udisplay the timelogin & logout members ?
What does sprintf mean?
Explain the JDB in depth & command line.
Where is const variable stored?
How to reverse string in java?
What are the four integer types supported by java?
Can I extend singleton class in java?
What are the different types of methodologies?
Can we have two main methods in a java class?
How many types of constructors are used in java?
What is a boolean expression in java?
What is the base class in java from which all classes are derived?
What is square root in java?