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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • None
    • None
    • docs
    • None

      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/

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

              Created:
              Updated:
              Resolved: