Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

methods (class and instance)

 
adam Lui
Ranch Hand
Posts: 186
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
whats the difference between class methods and instance methods?!
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A class method is declared with the keyword "static." This means it can be called using the class, even if no instance of that class is created.

An instance method is not static. It must be called using an instance.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic