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

getSuperClass() on arrays returns the wrong value

    XMLWordPrintable

Details

    • sparc
    • solaris_2.4

    Description

      If you create an array of Integer, getClass().getSuperClass() returns Object's class
      object. But if you ask if that array is an instanceof Number[], the answer is true.
      The second answer makes the most sense, since an Integer[] object acts as if it
      extends Number[]. It would seem that getSuperClass() of an array object should
      return a class object for an array of the element's superclass, and not return Object.

      Attachments

        Activity

          People

            fyellinsunw Frank Yellin (Inactive)
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: