Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #31919

Re: Direct Supertypes?

From Eric Sosman <esosman@comcast-dot-net.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: Direct Supertypes?
Date 2015-07-02 07:38 -0400
Organization A noiseless patient Spider
Message-ID <mn37of$5vv$1@dont-email.me> (permalink)
References <Supertypes-20150702023231@ram.dialup.fu-berlin.de>

Show all headers | View raw


On 7/1/2015 8:42 PM, Stefan Ram wrote:
>    There once was a publication called »JLS 7«, and it
>    had this definition:
>
> 4.10.2 Subtyping among Class and Interface Types
>
> Given a generic type declaration C<F1,...,Fn>, the direct
> supertypes of the parameterized type C<T1,...,Tn> are all
> of the following:
> o The direct superclasses of C.
> o The direct superinterfaces of C.
> o The type Object, if C is an interface type with no direct
>    superinterfaces.
> o The raw type C.
>
>    AFAIK, there is no special section for non-generic
>    supertypes, so I assume that the above is valid for
>    non-generic types C too (with n = 0).

     Since the quoted language specifically said "a generic
type," the assumption seems none too reliable ...

>    Now there is a publication called »JLS 8«, and it
>    has this definition:
>
> 4.10.2 Subtyping among Class and Interface Types
> Given a non-generic type declaration C, the direct
> supertypes of the type C are all of the following:
> o The direct superclass of C (§8.1.4).
> o The direct superinterfaces of C (§8.1.5).
> o The type Object, if C is an interface type with no
>    direct superinterfaces (§9.1.3).

     This is the new material in JLS 8, inserted immediately
before a nearly exact replica of the JLS 7 text you quoted.
One of the few differences between the 7 and 8 versions is
that 8 adds "(n > 0)" ...

>    No more »raw type C« for non-generic type declarations?
>
>    So, java.lang.String once was a direct supertype of
>    java.lang.String, but today it is not?

     As I understand the original, String was never a direct
supertype of String, because String is not and never was
a generic type.

-- 
esosman@comcast-dot-net.invalid
"Don't be afraid of work. Make work afraid of you." -- TLM

Back to comp.lang.java.programmer | Previous | Next | Find similar | Unroll thread


Thread

Re: Direct Supertypes? Eric Sosman <esosman@comcast-dot-net.invalid> - 2015-07-02 07:38 -0400

csiph-web