• Post Reply Bookmark Topic Watch Topic
  • New Topic

static import  RSS feed

 
ajaysharma fbd
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do static-import feature also imports static inner classess???
 
Winston Gutkowski
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ajaysharma fbd wrote:Do static-import feature also imports static inner classess???

I may be wrong, but I'm pretty sure that's why it was added. To be honest, I don't use them much, because I like to see the the outer class specified (more keystrokes for you, but a lot clearer for me ).

This is especially true when nested classes have generic names like 'Entry' or 'Builder'.

Winston
 
Stephan van Hulst
Saloon Keeper
Posts: 7973
143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I like to import enum constants. Here's an example of how you could set up a chess board:
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!