File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes package??? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "package???" Watch "package???" New topic


mei l.h.

Joined: Nov 12, 2002
Posts: 11
What does this code do?

Does the compiler create the new floders in the current location on your hard disk to place the class New?

Dirk Schreckmann

Joined: Dec 10, 2001
Posts: 7023
If, from the command line, you were to simply execute javac, then the class file would be compiled, but no directory structure would be created by the compiler and the compiled class file would be placed in the current working directory. The command javac -d . would create a directory structure in the current working that matched the package declaration and place the compiled class file in the appropriate subdirectory. Take a look at The javac Documentation for more information/details concerning the d and other switches available for use with javac.

[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
Andrew Fischer

Joined: Nov 18, 2002
Posts: 21
That code should generate a compiler error. You should fully specify the package name like this.

I always make the directories first. I'm not sure what happens if you don't.
[ November 25, 2002: Message edited by: Andrew Fischer ]

Andrew Fischer
mei l.h.

Joined: Nov 12, 2002
Posts: 11
Marilyn de Queiroz

Joined: Jul 22, 2000
Posts: 9059
mei l.h.


Initials are not a last name. Please change your displayed "last name" to comply with our naming policy. "firstName lastName"

Thank you for your co-operation.

"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
I agree. Here's the link:
subject: package???
jQuery in Action, 3rd edition