I don't like Perl OO too much, IMHO there are two many ways to do it! If you want to use OO in Perl I suggest to take a look at Moose. There is manual and a cookbook to get you started.

There are big differences, the two languages are completely different. On top of what ikegami said Let me add/clarify something on Inheritance. Perl supports both single and multiple inheritance. In Java multiple inheritance is not supported directly. This was a design decision. Instead Java has the concept of interfaces. According to some multiple inheritance is evil. The standard argument is the "diamond problem":

A / \ B C \ / D

Suppose a virtual method in A is implemented by both B and C. Question: Which one do you get when you instantiate D?

If you use the Java's interfaces it's not a problem, interfaces don't have implementations. If you make A, B, and C all interfaces, then D chooses how to implement the A method. The Java interfaces are a kind-of multiple inheritance but simplified. Having said this if you use abstract base clases with pure virtual functions (I'm thinking more C++ here) there is no reason why you can't use multiple inheritance.

Cheers

Harry


In reply to Re: difference between OOPs in Perl and java by dHarry
in thread difference between OOPs in Perl and java by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.