Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Definition clarity
Replies: 1   Last Post: Jun 25, 2013 10:48 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Steven Lord

Posts: 17,944
Registered: 12/7/04
Re: Definition clarity
Posted: Jun 25, 2013 10:48 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply



"MANIK " <mohitpant316@gmail.com> wrote in message
news:kqa758$f4r$1@newscl01ah.mathworks.com...
> what is the difference between instance methods and static methods

Instance methods need to be called on an instance of a class. For instance,
if you had a car class the getColor method would need to be an instance
method because each car can have a different color.

Static methods do not need a class instance to be called; they are
associated with the class as a whole. For instance, the aforementioned car
class could have a static method isCar that always returns true. We don't
need to examine a particular car to determine if it is a car; by definition,
cars are cars.

--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com



Date Subject Author
6/24/13
Read Definition clarity
MANIK
6/25/13
Read Re: Definition clarity
Steven Lord

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.