Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

methods (class and instance)  RSS feed

 
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
Boost this thread!