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
What is bufferedwriter?
What loop means?
What is meant by bytecode?
What is a nested structure?
What is constant in programming?
Is minecraft java edition free?
What is a byte string?
What is difference between Heap and Stack Memory?
What's the purpose of using break in each case of switch statement?
Difference between linkedlist and arraylist.
What data structures are used to perform recursion?
What is java command?
What is the difference between the boolean & operator and the && operator in java programming?
What is the purpose of an interface?
What is the parse method in java?