This week's book giveaway is in the JavaFX forum.
We're giving away four copies of Introducing JavaFX 8 Programming and have Herbert Schildt on-line!
See this thread for details.
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


Win a copy of Introducing JavaFX 8 Programming this week in the JavaFX forum!
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: 8661
    
  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: 4086
    
  18

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


The mind is a strange and wonderful thing. I'm not sure that it will ever be able to figure itself out, everything else, maybe. From the atom to the universe, everything, except itself.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: static import
 
It's not a secret anymore!