Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java static

 
Lucy Rai
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
please to reply about static in java deeply
 
Campbell Ritchie
Sheriff
Pie
Posts: 50196
79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Fields: do they belong to the class? Do you want one copy and one copy only? Do you want access before any objects are created?
Methods: please search for “Campbell Ritchie Classification of Methods”. Something ending in 68 can be static.

In most cases, it is a mistake to make anything static unless you know exactly why it ought to be static. In order to compile is a very bad reason to make something static.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic