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

Error in documentation on Array

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.2.2, 1.3.0
    • docs
    • generic
    • generic



      Name: skT88420 Date: 10/25/99


      D:\jdk\Documentation\api\java\lang\reflect\Array.html
      newInstance
      public static Object newInstance(Class componentType,
                                       int length)
                                throws NegativeArraySizeException
      Creates a new array with the specified component type and length. Invoking this method is equivalent to creating an array as follows:
       int[] x = {length];
       Array.newInstance[componentType, x];
       

      but { length ] doesnt work
      only {length} works
      (Review ID: 96960)
      ======================================================================

      Name: krT82822 Date: 01/01/2000


      (typo still exists in kestrel-beta docs)

      Typo: " int[] x = {length];"

      in the API there is an error.
      in the page:
      java.lang.reflect
      Class Array
      java.lang.Object
        |
        +--java.lang.reflect.Array

      it prints
      newInstance
      public static Object newInstance(Class componentType,
                                       int length)
                                throws NegativeArraySizeException
      Creates a new array with the specified component type and length. Invoking this
      method is equivalent to creating an array as follows:
       int[] x = {length];
       Array.newInstance[componentType, x];

      if you noticed, you decalred the array with {length]
      oops?!??!?!!?!!??!
      (Review ID: 99481)
      ======================================================================

            shommel Scott Hommel (Inactive)
            skonchad Sandeep Konchady
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: