What\'s the difference between a class method and an instance method?
Are instance methods the accessors (getters and setters) while class methods are pretty much ev
So if I understand it correctly.
A class
method does not need you to allocate instance of that object to use / process it. A class
method is self contained and can operate without any dependence of the state of any object of that class. A class
method is expected to allocate memory for all its own work and deallocate when done, since no instance of that class will be able to free any memory allocated in previous calls to the class method.
A instance
method is just the opposite. You cannot call it unless you allocate a instance of that class. Its like a normal class that has a constructor and can have a destructor (that cleans up all the allocated memory).
In most probability (unless you are writing a reusable library, you should not need a class
variable.