Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

package???

 
mei l.h.
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If, from the command line, you were to simply execute javac New.java, 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 . New.java 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.
 
Andrew Fischer
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
mei l.h.
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks
 
Marilyn de Queiroz
Sheriff
Posts: 9065
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
mei l.h.

Again,

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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic