Is the multiple inheritance in Java and Perl the same?
+7
A:
Don't know about Perl, but Java only allows multiple inheritance of interface. Only single-inheritance is allowed for implementation.
duffymo
2009-06-24 09:56:33
+7
A:
No. Perl doesn't have interfaces, and Java only allows multiple inheritance through interfaces.
James Thompson
2009-06-24 09:57:00
Actually the base perl object system hasn't got interfaces, but through additional extensions like Moose you can get roles which apparently are even better :)
wazoox
2009-06-24 11:50:28
That's a good point, I was only considering the core language, without CPAN modules.
James Thompson
2009-06-24 16:03:03
+23
A:
There is no multiple inheritance in Java, but single inheritance + multiple interface implementation, while Perl does have multiple inheritance.
streetpc
2009-06-24 09:58:47
+1 for saying Java doesn't allow multiple inheritance. Not even through interfaces, because thats not we call inheritance, arguably.
Adeel Ansari
2009-06-24 10:06:58
Good way to remember that: bad puns http://stackoverflow.com/questions/17512/computer-language-puns-and-jokes/17578#17578
streetpc
2009-07-10 10:19:11