in reply to Re^2: OOP and derived classes
in thread OOP and derived classes
but it's looks like its optional in Perl?Yes.
what happens when the base class is not instantiated and I call a base class method which accesses some base class properties ,through a derived object ?If, say, the object in question is a hash, then base class will find undef instead of whatever it wanted to find, like with all other hashes.
will the method be called as a base class method or will it be called as a derived one (the first parameter sent to the method would be a base object or a derived one?The base class will get the whole thing, 100% of it. So, in Java's terms, the base method will get the derived object.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: OOP and derived classes
by Anonymous Monk on Feb 14, 2015 at 21:04 UTC | |
by LanX (Saint) on Feb 14, 2015 at 22:28 UTC | |
by Arunbear (Prior) on Feb 15, 2015 at 13:41 UTC | |
by choroba (Cardinal) on Feb 14, 2015 at 21:38 UTC | |
by Anonymous Monk on Feb 14, 2015 at 22:21 UTC |