aspose file tools*
The moose likes Beginning Java and the fly likes static import Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "static import" Watch "static import" New topic
Author

static import

ajaysharma fbd
Greenhorn

Joined: Aug 06, 2012
Posts: 2
Do static-import feature also imports static inner classess???
Winston Gutkowski
Bartender

Joined: Mar 17, 2011
Posts: 8223
    
  23

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


Isn't it funny how there's always time and money enough to do it WRONG?
Articles by Winston can be found here
Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 3649
    
  17

I like to import enum constants. Here's an example of how you could set up a chess board:
 
wood burning stoves
 
subject: static import