File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Dan's question ambiguity Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Dan Watch "Dan New topic
Author

Dan's question ambiguity

Vad Fogel
Ranch Hand

Joined: Aug 25, 2003
Posts: 504

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.
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
Originally posted by Vad Fogel:

I believe, the question should mention that an interface is not a member of public or default access top level class for clarity.

Why? The question says it is not a member of an enclosing class or interface.


Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
Vad Fogel
Ranch Hand

Joined: Aug 25, 2003
Posts: 504
Because if there's a top level class declared public, then the interface itself cannot be declared public.
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
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.
Vad Fogel
Ranch Hand

Joined: Aug 25, 2003
Posts: 504
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.
Dan Chisholm
Ranch Hand

Joined: Jul 02, 2002
Posts: 1865
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>
bengt hammarlund
Ranch Hand

Joined: Oct 17, 2003
Posts: 78
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>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Dan's question ambiguity
 
Similar Threads
Exceptions in Overriding methods??
Regarding Top Level Nested Interface
instanceof Q? for SCJP
implementing two interfaces with the same method name!
Prefering interface over class inheritance