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

Java Tutorial, lesson on classes states (indirectly) that interfaces inherit from Object

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: docs
    • Labels:
      None

      Description

      The first sentence on the lesson on classes (http://docs.oracle.com/javase/tutorial/reflect/class/index.html) reads as follows:

      > Every object is either a reference or primitive type. Reference types all inherit from java.lang.Object. Classes, enums, arrays, and interfaces are all reference types.

      This is wrong. The first sentence doesn't make sense (objects aren't of primitive type) and interfaces do not inherit from java.lang.Object. See JLS, Section 9.2 Interface Members.

      I would suggest replacing this with something like:

      > Every type is either a reference or a primitive. Classes, enums, arrays (which all inherit from java.lang.Object) as well as interfaces are all reference types.

      Related discussion: http://stackoverflow.com/questions/6056124/do-interfaces-inherit-from-object-class-in-java/

        Attachments

          Activity

            People

            Assignee:
            rgallard Raymond Gallardo
            Reporter:
            alundblad Andreas Lundblad (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: