can you create interface instance ?

Answer Posted / devir

No,Uday is wrong.
He has created an anonymous inner class Test with the same
name as interface Test.It doesn't depend on the interface Test.
If an instance for interface Test has to be created ,he
sholud have implement interface Test such as
class Main implements Test{
}

Is This Answer Correct ?    17 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why is an interface be able to extend more than one interface but a class can’t extend more than one class?

707


What is the constructor?

581


Why main method is static in java?

596


What is string manipulation?

497


What is a dot notation?

552






How do you clear a list in java?

603


What do you mean by hashing?

645


What is a get method?

535


What is binary tree in java?

536


What is square root in java?

588


How to reverse a string in java?

526


What are different types of constants?

518


what is thread? : Java thread

559


List out five keywords related to exception handling ?

600


How to do encapsulation in java?

570