• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Dan's question ambiguity

 
Vad Fogel
Ranch Hand
Posts: 504
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 13974
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Vad Fogel
Ranch Hand
Posts: 504
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because if there's a top level class declared public, then the interface itself cannot be declared public.
 
Thomas Paul
mister krabs
Ranch Hand
Posts: 13974
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 504
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1865
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
bengt hammarlund
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic