views:

209

answers:

3

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
+7  A: 

No. Perl doesn't have interfaces, and Java only allows multiple inheritance through interfaces.

James Thompson
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
That's a good point, I was only considering the core language, without CPAN modules.
James Thompson
+23  A: 

There is no multiple inheritance in Java, but single inheritance + multiple interface implementation, while Perl does have multiple inheritance.

streetpc
+1 for saying Java doesn't allow multiple inheritance. Not even through interfaces, because thats not we call inheritance, arguably.
Adeel Ansari
Good way to remember that: bad puns http://stackoverflow.com/questions/17512/computer-language-puns-and-jokes/17578#17578
streetpc