• Post Reply Bookmark Topic Watch Topic
  • New Topic

java packages  RSS feed

 
vignesh gopalakrishnan
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi guys ..?? please look at the following code ..



[Added code tags - please read UseCodeTags]

this is a simple java program , where , i did created a package named pkg . After compilation of this program i expected that the compiler automatically creates a folder name pkg , and it puts the java file name simplepack.java and it class file in it .. but it didn't happened .. after reading some information about package in internet , what i got is , you have to create a folder in the bin directory which should be named as pkg (which is my package name ) and put the java file and class file inside the folder , then compile the program and execute it..!! what is the benefit in doing this... i mean this is what we are doing in a simple java programs isn't it ..?? is there any most significant difference which i yet to get cleared ..?? thanks in advance ....
 
Campbell Ritchie
Marshal
Posts: 56578
172
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I suggest you have a look at a few this old post , this one, and parts of the Java Tutorials: No 1 No 2.

No, the compiler does not automatically create a folder structure to match your package names. It might have been designed like that, but it wasn’t.
 
vignesh gopalakrishnan
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:I suggest you have a look at a few this old post , this one, and parts of the Java Tutorials: No 1 No 2.

No, the compiler does not automatically create a folder structure to match your package names. It might have been designed like that, but it wasn’t.




sorry campbell ritchie .. i viewed my email right now. thats why i didn't replied to this .. and thanks, i saw your suggestion .. now i got my doubt cleared up .. any ways thanks a ton campbell ritchie.. and also i have to say one thing .. you are helping me a lot in this forum .. i got maximum of replies only from you for my questions... thanks yaar .. !!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!