Results 1 to 2 of 2
  1. #1
    sasikumardr is offline Member
    Join Date
    Dec 2007
    Rep Power

    Question Creating Array of LinkedList

    Hi friends,
    I want to create an array of LinkedList using generic class.
    I tried following Code

    LinkedList<Integer> [] Cards=new LinkedList<Integer>[Shuffles];

    It Showed Generic array creation Error.
    when I changed it to
    LinkedList<Integer> [] Cards=new LinkedList[Shuffles];
    Error Changed into Warning and I could run it in my machine.
    Now problem is I am participating online competition where I have to submit code to Online Judge. They wont allow any warning. I want to create Array of Linked List without any warning,

  2. #2
    staykovmarin is offline Senior Member
    Join Date
    Nov 2007
    Newport, WA
    Rep Power


    There are quite a few problems with what you are saying. Here is all the information about it:
    Generics - Generic Arrays - No more unsound than Generics in general

    Its a well known issue.

Similar Threads

  1. Creating an array of nonprimitive objects
    By Java Tip in forum java.lang
    Replies: 0
    Last Post: 04-14-2008, 08:46 PM
  2. Need help with creating array of type object
    By riz618 in forum New To Java
    Replies: 3
    Last Post: 01-29-2008, 06:14 AM
  3. Replies: 0
    Last Post: 12-05-2007, 02:09 PM
  4. creating array at runtime
    By javaplus in forum New To Java
    Replies: 4
    Last Post: 11-08-2007, 10:06 PM
  5. how to use LinkedList
    By fred in forum Advanced Java
    Replies: 1
    Last Post: 07-24-2007, 01:52 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts