Article View: comp.lang.java
Article #18Are "super" and "this" different objects?
From: David L. Shang
Date: Mon, 23 Oct 1995 15:44
Date: Mon, 23 Oct 1995 15:44
22 lines
1207 bytes
1207 bytes
I don't think it is proper for Java to use SmallTalk-like "super" to refer to members defined in superclasses. C++ and SmallTalk uses a different inheritance mechanism. In SmallTalk, the member defined in superclasses actually exists in superclass. SmallTalk uses dynamic inheritance, therefore, "this" and "super" are different objects. In C++, there shouldn't be a distinction of objects: an object of subclass and an object of superclass. It is a single object viewing in different types: in the superclass and in the subclass. Languages uses static inheritance usually use scope selector to decide which memeber (defined in superclass or subclass) should be used. The Java Specification at the bottom of page 10 introduces confusions. David Shang
Technical Details
Message-ID:
<1995Oct23.154442.6836@schbbs.mot.com>Path:
arc1-ca.pugleaf.net!in2.uu.net!ftpbox!mothost!schbbs!newsShow Full Headers
Complete Article Headers
Newsgroups: comp.lang.java,comp.object,comp.lang.c++ Path: arc1-ca.pugleaf.net!in2.uu.net!ftpbox!mothost!schbbs!news From: shang@corp.mot.com (David L. Shang) Subject: Are "super" and "this" different objects? Reply-To: shang@corp.mot.com Organization: MOTOROLA Date: Mon, 23 Oct 1995 15:44:42 GMT Message-ID: <1995Oct23.154442.6836@schbbs.mot.com> Sender: news@schbbs.mot.com (SCHBBS News Account) Nntp-Posting-Host: 129.188.128.126