• Post Reply Bookmark Topic Watch Topic
  • New Topic

static import  RSS feed

 
Mukesh Prajapati
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
please explain me 'static import'
 
Campbell Ritchie
Marshal
Posts: 56600
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
webpage

I disagree about "use very sparingly". I would say you need to make sure the names imported have an obvious meaning, and follow the usual Java™ naming conventions, and the members of your class have clear names, too. Then you won't get any confusion.
 
Mukesh Prajapati
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this not satisfy me please help me
 
Suhas Mandrawadkar
Ranch Hand
Posts: 72
Android Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is used to reduce few keystrokes and import class's static members.

For ex:



can be used as



if it is a static import, i.e:

 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!