• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Two Packages in the Same Directory?

 
Sheriff
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Mac Safari Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Mac Safari Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
reply
    Bookmark Topic Watch Topic
  • New Topic