• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

static import and enums

 
Paul Prusko
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's a matter of style. I'm not sure that "import static" makes codes easier to read, but that's my opinion.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic