• Post Reply Bookmark Topic Watch Topic
  • New Topic

static  RSS feed

 
prans rao
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello
Actually what are static class and general class? what is the difference between them?
In the same way,
what are static method and general method? what is the difference between them?
 
Campbell Ritchie
Marshal
Posts: 56529
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What's a static class? That came up a few months ago, but the thread reappeared here; have a look at that.

A static method is one which doesn't alter or read any instance fields or invoke any instance methods in the same class. It does not therefore belong to the object, but to the class. You invoke it by the name of the class, rather than the name of the object. Static methods cannot be overridden (see this FAQ).
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!