Re: Several questions
Re: Several questions
- Subject: Re: Several questions
- From: email@hidden
- Date: Fri, 6 Jul 2001 14:06:02 -0700
>
Well, I know what a class is, and I know what an instance is,
>
but what is an "instance method" as opposed to a "class method"?
>
I never considered the possibility that a method would be
>
instantiated, as contrasted with data members/instance variables.
A class method can be called when there are no instances of the object.
It's very similar to having a public static method in Java. Class methods
do not have access to instance variables. The most common use of class
methods are factory methods that create and return an instance for you.