Originally posted by Mani:
Marcus no:7
Which of the following statements are true?
1) An interface can only contain method and not variables
2) Java does not allow the creation of a reference to an interface with the new keyword.
3) A class may extend only one other class and implement only one interface
4) Interfaces are the Java approach to addressing its single inheritance model, but require implementing classes to create the functionality of the Interfaces.
Ans given is 4)
I think choice 2 is also correct.
Java won't allow creation of the reference of an interface with new keyword. Actually if we do so we won't get the reference to the interface but will get reference to an anonymous inner class which implements the interface. Correct me if I am wrong.
RGDs
Manoj
Open Group Certified Distinguished IT Architect. Open Group Certified Master IT Architect. Sun Certified Architect (SCEA).
Willie Smits can speak 40 languages. This tiny ad can speak only one:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
|