Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

jdavidb (1361)

jdavidb
  (email not shown publicly)
http://voiceofjohn.blogspot.com/

J. David Blackstone has a Bachelor of Science in Computer Science and Engineering and nine years of experience at a wireless telecommunications company, where he learned Perl and never looked back. J. David has an advantage in that he works really hard, he has a passion for writing good software, and he knows many of the world's best Perl programmers.

Journal of jdavidb (1361)

Thursday January 10, 2008
08:53 AM

Java inheritance

[ #35350 ]

I've been on the new job a month as of today. Most of that time has been spent getting up to speed on Java itself.

Yesterday I was getting some weird errors out of my IDE that didn't make any sense at all. It kept saying it couldn't find a certain constructor I was expecting to be there. I vaguely remembered having a similar error last week with the command-line javac and a couple of classes I was playing with; I'd fixed it by working around it since I wasn't devoted to getting those classes perfect.

But yesterday I wanted to find out what was going on. I started Googling and digging through a Java book. Finally I realized what was happening:

Ladies and gentlemen, after nearly a month of solid Java study, I did not realize until late yesterday afternoon that while Java subclasses inherit methods, they do not inherit constructors.

Papa always said I was oblivious. :)

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • I'm not sure I realized that either :/

    I did a whole Java project without apparently realizing it.
    • ROTFL! Now I feel better!

      I'm also still struggling with the fact that constructors aren't really methods that just happen to return a new object. In fact they don't return anything at all.

      I believe the site I found that clarified the issue of method inheritance vs. constructor inheritance stated that calling constructors methods was a bit like saying the platypus was just another mammal. But then, when I finally tracked down the statement about the lack of constructor inheritance in O'Reilly's Learni

      --
      J. David works really hard, has a passion for writing good software, and knows many of the world's best Perl programmers