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

What is string [] java?

530


How long will it take to learn java?

511


What is a native method in java programming?

532


Explain about wait() method?

571


What do you mean by constant time complexity?

604






List out five keywords related to exception handling ?

605


When to use runnable interface vs thread class in java?

526


Is sizeof a preprocessor?

547


What are strings in physics?

551


What is anti pattern in java?

520


What is static and final keyword in java?

577


What is the difference between path and classpath variables?

533


What's the purpose of using break in each case of switch statement?

514


What is null mean in java?

627


What are classloaders?

601