File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

static import

ajaysharma fbd

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

Joined: Mar 17, 2011
Posts: 8657

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'.


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

Joined: Sep 20, 2010
Posts: 3780

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