Typo in 'Restrictions on Generics"

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P5
    • None
    • Affects Version/s: None
    • Component/s: docs
    • None

      In

      http://docs.oracle.com/javase/tutorial/java/generics/restrictions.html#createArrays

       If you try the same thing with a generic list, there would be a problem:

      Object[] stringLists = new List<String>[]; // compiler error, but pretend it's allowed
      stringLists[0] = new ArrayList<String>(); // OK
      stringLists[1] = new ArrayList<Integer>(); // An ArrayStoreException should be thrown,
                                                  // but the runtime can't detect it.


      new List<String>[] -> new List<String>[2];

            Assignee:
            Bernard Horan (Inactive)
            Reporter:
            Raymond Gallardo
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: