can you create interface instance ?
Answer Posted / arun savoji
This expression instantiates a new object from an unnamed
(called anonymouns inner class)and previously undefined
class, which automatically implements the interface Test.
The class can explicitly implement one, and only one
interface, and cannot extend any class other than Object.
As it implement the Test interface so our anonymous inner
class has to implement the methods in this case we have to
implement wish() method.
In java we can not create instance of an interface, since
interface do not have contructor and as well as defalut
contructor.
| Is This Answer Correct ? | 9 Yes | 0 No |
Post New Answer View All Answers
Why do we need autoboxing in java?
Can you pass by reference in java?
how does the run() method in runnable work? : Java thread
What is the difference between yielding and sleeping?
What do you mean by multithreaded program?
What are the differences between forwarding () method and sendredirect() methods?
What is the difference between static and non-static variables in java programming?
What are the advantages of exception handling?
What is regex in java?
What is a memory leak in java?
Why lambda expression is used in java?
What are the problems faced by java programmers who don't use layout managers?
If you do not want your class to be inherited by any other class. What would you do?
Can sleep() method causes another thread to sleep?
What does ide stand for?