Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8271345

9.6.4.4: Avoid stating that an interface does not have Object as a supertype

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P4
    • 17
    • 16
    • specification

    Description

      Since JLS7, the section on `@Override` has said in a note that an interface does not have Object as a supertype (see https://docs.oracle.com/javase/specs/jls/se7/html/jls-9.html#jls-9.6.3.4 and https://docs.oracle.com/javase/specs/jls/se16/html/jls-9.html#jls-9.6.4.4) :

      -----
      For the interface declaration, consider that while an interface does not have Object as a supertype, an interface does have public abstract members that correspond to the public members of Object (§9.2). If an interface chooses to declare them explicitly ...
      -----

      Section 4.10.2 "Subtyping among Class and Interface Types" was clarified in JLS8 to state that an interface can have Object as a supertype. Therefore, the 9.6.4.4 note ought to read:

      -----
      For the interface declaration, consider that an interface has public abstract members which correspond to the public members of Object (§9.2). If an interface chooses ...
      -----

      Attachments

        Activity

          People

            abuckley Alex Buckley
            abuckley Alex Buckley
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: