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

Can we assign null to double in java?

787


Is string pool garbage collected?

791


Why does the integer quotient -0/3 yield 0, but the double quotient -0.0/3.0 yields – 0.0?

838


What is the use of conditional statement?

771


List some important characteristics on jre

849


How many types of java are there?

777


Does every java program need a main?

787


What is Java Reflection API? Why it’s so important to have?

879


Why java applets are more useful for intranets as compared to internet?

830


What is finalize method?

850


What is the difference between hashset and treeset in java?

800


Which is bigger double or float?

758


What is the maximum size of hashmap in java?

767


In java, how we can disallow serialization of variables?

766


What is the point of polymorphism java?

782