Question 8, comprehensive exam 10 Suppose that an interface, I1, is not a member of an enclosing class or interface. Which of the following modifiers can be applied to interface I1? a. abstract b. public c. static d. synchronized e. transient f. volatile
I believe, the question should mention that an interface is not a member of public or default access top level class for clarity.
Because if there's a top level class declared public, then the interface itself cannot be declared public.
Joined: May 05, 2000
Your statement is incorrect because you state: the question should mention that an interface is not a member of public or default access top level class for clarity. He already says that. You should have stated that the question should mention that it is not in a source file containing a top level public class or interface. There is a vast difference.
Joined: Aug 25, 2003
Agree. This is the case when one thinks right, but the idea is expressed incorrectly as I did. I thought what you posted, but used the wrong way to say it.
Originally posted by Vad Fogel: Because if there's a top level class declared public, then the interface itself cannot be declared public.
Vad, you are now getting much closer to being correct. If the interface is declared public, then it must be declared in a file that shares the same name as the interface. It's been about a year since I took the exam myself. At this point, I don't recall that the real exam states all such details explicitly. I know that the exam requires the reader to make some reasonable assumptions, and this might be an example of a question where the reader should make an assumption. Even so, I welcome more opinions on this. I am hesitant to state every imaginable precondition in every question if the real exam does not do the same. If the users of my exam start expecting to find that level of detail in each question, then they might be inclined to have the same expectations on the real exam. If that detail is missing from the real exam questions, then some people might conclude that every statement on the real exam is false. I hope that we can hear from some people that have taken the exam recently.
Dan Chisholm<br />SCJP 1.4<br /> <br /><a href="http://www.danchisholm.net/" target="_blank" rel="nofollow">Try my mock exam.</a>
I've taken the exam TODAY and I think this question is OK. It's clear that you have to make some assumptions like Dan said, and in this case I think the assumption it's pretty straitfoward, if you're to consider yourself ready for the exam.
<b><i>Bengt Hammarlund</i><br />� Sun Certified Java Programmer</b>