File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes default package related query Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "default package related query" Watch "default package related query" New topic
Author

default package related query

Poorvika Chandra
Greenhorn

Joined: Jun 27, 2011
Posts: 3
Dear all,

As we know it is not recommended to write classes under default package.Then what might be the purpose behind the introduction of default packages in java

Regards
Poorvika
Ogeh Ikem
Ranch Hand

Joined: May 13, 2002
Posts: 180
You can compile and run a class in a default package (just like any other class). The only problem is that you cannot import the default package.
Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 3615
    
  14

The purpose of the default package is to enable people to quickly write very small test programs or example code, without cluttering it with the package declaration.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38449
    
  23
And welcome to the Ranch
Poorvika Chandra
Greenhorn

Joined: Jun 27, 2011
Posts: 3
Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: default package related query