Very Confused on Page 33
From: eBob.com (eBob.com_at_totallybogus.com)
Date: 01/29/05
- Next message: Erwin Moller: "Re: Very Confused on Page 33"
- Previous message: Ryan Stewart: "Re: What's the diff PrintWriter vs. OutputStreamWriter ?"
- Next in thread: Erwin Moller: "Re: Very Confused on Page 33"
- Reply: Erwin Moller: "Re: Very Confused on Page 33"
- Reply: Matt Humphrey: "Re: Very Confused on Page 33"
- Reply: Fuddzy: "Re: Very Confused on Page 33"
- Reply: eBob.com: "( Very Confused on Page 33) Thanks! to the Many Responders ..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 29 Jan 2005 10:53:59 -0500
I am only on page 33 of Bruce Eckel's "Thinking in Java" and I am so
confused by one point that I can go no further without getting this
straightened out. On page 33 Bruce is explaining inheritance. The text
which confuses me is " ... all the messages you can send to objects of the
base class you can also send to objects of the derived class. Since we know
the type of a class by the messages we can send to it, this means that THE
DERIVED CLASS IS THE SAME TYPE AS THE BASE CLASS. ..." (emphasis added)
I am not totally unfamiliar with OOP and I understand that all messages
which can be sent to objects of a base class can also be sent to objects of
the derived class. BUT, I would think that, in general, the inverse is not
true. Without getting into what the meaning of is is, am I supposed to
understand that the derived class is the same type as the base class, but
the base class is not the same type as the derived class?
But even if that would resolve the confusion which I have explained so far,
what about "Overriding base-class functionality" - the topic which is
comming up at the bottom of the page. Even assuming that "the derived class
is the same type as the base class" is not meant to be a symmetric
statement, is it true even though the derived class might have overridden
functions? I would think that the compiler would need to be able to
distinguish between objects of the base class and objects of the derived
class. How would it do that if they both are of the same type?
If anyone can help get me past this confusion I'd appreciate it.
Thanks, Bob
- Next message: Erwin Moller: "Re: Very Confused on Page 33"
- Previous message: Ryan Stewart: "Re: What's the diff PrintWriter vs. OutputStreamWriter ?"
- Next in thread: Erwin Moller: "Re: Very Confused on Page 33"
- Reply: Erwin Moller: "Re: Very Confused on Page 33"
- Reply: Matt Humphrey: "Re: Very Confused on Page 33"
- Reply: Fuddzy: "Re: Very Confused on Page 33"
- Reply: eBob.com: "( Very Confused on Page 33) Thanks! to the Many Responders ..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|