Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Two Packages in the Same Directory?

 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The following is question #58 from Marcus Green's 1.2 Mock Exam No. 1.
(Note that two separate files are illustrated in the code.)

SOURCE: http://www.jchq.net/mockexams/exam1.htm


The answer is 4, with the explanation, "Using the package statement has an effect similar to placing a source file into a different directory. Because the files are in different packages they cannot see each other..."

I'm fine with the answer (4), but I'm questioning the justification provided: "Using the package statement has an effect similar to placing a source file into a different directory." Since these files are each supposed to be in their own package, aren't they required to be in different directories?

To me, the "similar to" wording would be applicable if both files were in a directory called "Class1," and the Base file didn't declare a package at all. But as the question reads, the problem here is more than just package declaration.

Am I reading too much into this, or am I missing something?

[ September 30, 2004: Message edited by: marc weber ]

(fixed for width)
[ September 30, 2004: Message edited by: Barry Gaunt ]
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tend to agree. Maybe "effect of" would have been a better choice than "effect similar to".

I guess Marcus will be around to beat us up
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
PS: Why is my original post so wide -- extending horizontally off the screen?



I tried saving it as a simple text file to get rid of any weird paragraph formatting, then re-pasting it, but it's still doing it. (Or is it just my browser?)
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Within [C0DE][/C0DE] tags there is no automattic wrapping. So you have to keep your lines short.
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Barry Gaunt:
Within [C0DE][/C0DE] tags there is no automattic wrapping. So you have to keep your lines short.

Ah... Thank you!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic