Results 1 to 2 of 2
  1. #1
    rhm54 is offline Member
    Join Date
    Jan 2008
    Posts
    12
    Rep Power
    0

    Default Declaring a Queue

    I am trying to declare a Queue like so:

    Queue<Object> BFSqueue = new LinkedList<Object>();

    but I keep getting this error message:

    The type LinkedList is not generic; it cannot be parameterized with arguments <Object>

    What am I doing wrong?

  2. #2
    roots's Avatar
    roots is offline Moderator
    Join Date
    Jan 2008
    Location
    Dallas
    Posts
    293
    Rep Power
    10

    Default

    Check if there are two version of LinkedList in the class path .. Make sure you have JDK1.5 +. Otherwise code is okay ..
    dont worry newbie, we got you covered.

Similar Threads

  1. Queue data structure
    By Java Tip in forum java.lang
    Replies: 0
    Last Post: 04-14-2008, 08:35 PM
  2. How to implement Priority queue with Java
    By Java Tip in forum java.lang
    Replies: 0
    Last Post: 04-12-2008, 08:49 PM
  3. Help with queue array please!!
    By vmcg105 in forum New To Java
    Replies: 1
    Last Post: 03-08-2008, 08:03 PM
  4. Declaring an ArrayList
    By bugger in forum New To Java
    Replies: 3
    Last Post: 01-31-2008, 08:36 PM
  5. Using a queue
    By Krmeus in forum New To Java
    Replies: 0
    Last Post: 12-10-2007, 04:38 PM

Posting Permissions

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