in reply to difference between OOPs in Perl and java
what is difference between Oops concepts in Perl and Java in terms of implementation.
Perl's builtin object model is pretty fundamental. It allows for arbitrary models to be used.
Encapsulation
Perl doesn't define how to implement attributes, so encapsulation is up to the specific model used.
In most cases, the attributes are easily accessible from the outside, but encapsulation is still very strong. It's just that it's enforced by policy, not by technical means.
Inheritance
Single and multiple. Two different method resolution order for multiple inheritance.
Polymorhpism
Yes. All methods are virtual, basically.
|
|---|