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).]
Anonymous
Ranch Hand
Joined: Nov 22, 2008
Posts: 18944
posted
0
Whats' the qstn# exam 3 ? Regds. - satya
[This message has been edited by satya5 (edited June 07, 2000).]
Suma Narayan
Ranch Hand
Joined: Apr 03, 2000
Posts: 136
posted
0
Vivek, Yes, 2 should also be true. Interfaces can't have constructors.
Satya,
It is question #7 in Exam3. Suma.
Herbert Maosa
Ranch Hand
Joined: May 03, 2000
Posts: 289
posted
0
Suma, you are quoting the question wrongly.Please find the original question below, verbatim.
Question 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 the single inheritance model, but require implementing classes to create the functionality of the Interfaces.
This is definately different from what you are presenting.Please try to give a question as it appears in your source, verbatim, for people to give you accurate information. Regards, Herbert.
Anonymous
Ranch Hand
Joined: Nov 22, 2008
Posts: 18944
posted
0
Herbert/Suma: Suma is correct. I just checked the site and the qstn #7 appears to have changed(but the ans hasn't ). The copy I have is same as what Herbert has. However, the website has the qstn orginally posted. Seems to be updated but the date hasn't been changed. We should keep in mind that exam3 is in half-baked state.... Marcus, knock knock ..... Regds. - satya
Marcus Green
arch rival
Rancher
Joined: Sep 14, 1999
Posts: 2813
posted
0
Should be fully baked now!, It is now fully accurate and contains no errors whatsoever. Marcus
Herbert, When I first saw the question, I thought the question is different from what I answered a few days back. I too have the same version as you have quoted. But then , I checked the site and saw the change in option #2. Hi everyone, Today, once again, I checked the answer and it says only 4. IMHO, It should include option #2 also. Suma.
Jim Yingst
Wanderer
Sheriff
Joined: Jan 30, 2000
Posts: 18652
posted
0
I assume Marcus' "fully baked" comment had an invisible smiley . As of today the online version still says that "Interfaces cannot have constructors" is false, which is incorrect. So I'm moving this to Mock Exam Errata to draw Marcus' attention.
"I'm not back." - Bill Harding, Twister
Marcus Green
arch rival
Rancher
Joined: Sep 14, 1999
Posts: 2813
posted
0
Ashly I was just trying to provoke someone to double check it and it certainly needed it. It really really should be fixed now, er I think.
Anonymous
Ranch Hand
Joined: Nov 22, 2008
Posts: 18944
posted
0
They exam has choosen options as 2,4.I checked today.