in reply to Static method vs virtual method
Static methods expect a class name as the first argument. Generally, static methods ignore the first argument because they already know which class they are in. new() is implemented by almost all packages as a static method. Static methods aren't called from an instance of an object, but instead directly from the package name:
Virtual methods or instance methods expect a reference to an object as the first argument. Static methods are class-wide; virtual methods are object-specific.
The great pleasure in my life is doing what people say you cannot do.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Static method vs virtual method
by przemo (Scribe) on May 09, 2009 at 12:26 UTC | |
by freonpsandoz (Beadle) on Oct 14, 2016 at 05:42 UTC | |
by choroba (Cardinal) on Oct 14, 2016 at 08:28 UTC |