aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes static import and enums Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "static import and enums" Watch "static import and enums" New topic
Author

static import and enums

Paul Prusko
Greenhorn

Joined: Feb 16, 2008
Posts: 25
Hi Ranchers,
I think highly of your time so if you find a minute, please, consider the following:
In case we define an enum inside a class in one package and then would like to use it in another one, what is the proper way to import it: static import or "classic" import statement since I noticed they both work and allow to use the enum name without class qualification. Similar question applies to members which are static nested classes. What do you think is correct? Appreciate your involvement.
Joe Fischer
Greenhorn

Joined: May 02, 2008
Posts: 25
That's a matter of style. I'm not sure that "import static" makes codes easier to read, but that's my opinion.


SCJP-SE6.0
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: static import and enums