LiveWire Network Peer Answers Peer Support Teen Forums Tech Forums College Forums 696 users online 221781 members 1135 active today Advertise Here Sign In
TeenCollegeTechPhotos | Quizzes | LiveSecret | Memberlist | Dictionary | News | FAQ
Member Spotlight
Oceanborn
Interests: writing, dancing, singing, music, a...
Mood: Scheming
You have 1 new message.
Emergency Help
Until you sign up you can't do much. Yes, it's free.

Sign Up Now
Membername:
Password:
Already have an account?
Invite Friends
Active Members
Groups
Contests
Moderators
5 online / 34 MPM
Fresh Topics
  LiveWire / Technical Forums / Programming & Application Development / Viewing Topic

base / super class constructor issue -- C# / Java
Replies: 4Last Post Jan. 2 8:54pm by Yer Ghey
Welcome to LiveWire!
We're Stronger Together.
Join the Community
Single page for this topic Email Print Favorite
( Whuppee )


Dairy Product Addict

Ad Free
Reply
So, i didn't want to go too crazy with the title:

This isn't about C# / Java, exclusively.  I'm sure there are at least some other languages that effectively handle this in the same way.  However, C# / Java are the only languages I'm currently working with, and I didn't especially want to start downloading other compilers / libraries just to see how widespread this is.

Also, here is what I'm doing, not why.  I'll be happy to answer curiousity, but not before it's expressed =P


The issue?

In any given subclass, IF I don't personally include a call in its constructor to its superclass' constructor, the language makes the call automatically.

My question / issue

Is this necessary?

Before any of these classes are even available for my use, the class loaders will have run.  All methods will have been placed in their respective look-up tables.  Static constructors, if present, will run.  Any declarations of class / instance attributes that happen to be paired with initialization calls will be done.


So... in the example of instantiating a subclass.  

Suppose the superclass has no attributes that need initialized.  Repeat: the superclass constructor does not have a single line in it.

What, then, is the purpose of forcing a call either manually or otherwise to this constructor?

Note: if only the languages hadn't seen fit to FORCE this call, I could easily answer this question for myself.

So far as I'm aware, anyway.. the subclass already has access to all the methods of its superclass.  They can be referenced internally as well as externally through representation.


In this example, I see no reason to mandate a call to the superclass' constructor.


Anyone?

1) Bottom line, why force this?  Even if it is necessary, was making it virtually impossible for me to conclusively test this important enough to save me from typing 7-8 characters?  Seriously, if typing that little is "the problem"--you're the problem.

2) IS this necessary?  Why?


And really, I do have a pretty good reason for wanting to do this.  =P

(that is, for wanting to have the mandated call to the superclass eliminated)

Edit:

Succinctly, the only visible thing I am able to observe a (super class) constructor doing is initializing variables.  What, if any, other things are they doing that the languages are hiding from view?

(Edited by Whuppee at 3:41 am on May 31, 2006)

-------
Unbelievably awesomesauce to the absurd degree that I wet myself.
Who else has created a LW/magnets
so explicit the mods deleted a screencap of it? =P


9:14 pm on May 28, 2006 | Joined: May 2002 | Days Active: 363
Join to learn more about Whuppee Oregon, United States | Lesbian Male | Posts: 1,505 | Points: 7,166
LiveWire Humor
Post from this position was omitted due to content violations
Yer Ghey

Novice
Reply
JEWISH PENOR!

8:52 pm on Jan. 2, 2009 | Joined: Jan. 2009 | Days Active: 1
Join to learn more about Yer Ghey Bermuda | Posts: 14 | Points: -976
XxXJAMSTERXxX


Novice
Reply
JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS JEWISH PENIS

8:52 pm on Jan. 2, 2009 | Joined: Jan. 2009 | Days Active: 1
Join to learn more about XxXJAMSTERXxX United States | Posts: 3 | Points: 3
Yer Ghey

Novice
Reply
JEWISH PENOR!

8:54 pm on Jan. 2, 2009 | Joined: Jan. 2009 | Days Active: 1
Join to learn more about Yer Ghey Bermuda | Posts: 14 | Points: -976
Single page for this topic Email Print Favorite

Quick Reply

You are signed in as our guest.

Looking for something else?
 

  LiveWire / Technical Forums / Programming & Application Development / Viewing Topic