This Question is from Exam #3
Which of the following statements are true?
1) An interface can only contain method and not variables
2) Interfaces cannot have constructors
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.
it says answer is 4.
But what is wrong with 2. i think it should be part of answer because i tried following code
interface
Test {
Test();
}
it gave me error "interface can't have constructors".
feel free to correct me and explain what is going on here?
vivek
[This message has been edited by Vivek Shrivastava (edited June 07, 2000).]