Results 1 to 2 of 2
  1. #1
    trill is offline Member
    Join Date
    Jul 2007
    Posts
    40
    Rep Power
    0

    Default Help with linked list

    Hi, I have a file that has a database of customers in it. Each customer has 5 attributes and i need to read them into an object and put them into a linked list. I cant seem to find a good example of a linked list code anywhere. Could someone please give me some code that will get me moving.
    Thanks.

  2. #2
    zoe
    zoe is offline Member
    Join Date
    Jul 2007
    Posts
    40
    Rep Power
    0

    Default

    Your question is too easy...all what you need is to create a new class and put in it 4 variables that you wanna add to the linked list...
    then, make a constructor to initialize them to the proper values..
    and from the test class:
    Java Code:
    YourObjectName ob = new YourObjectName(var1, var2, var3, var4)
    as you arranged them in your class constructor...
    them simply use your linked list reference to add your object..
    for example:
    Java Code:
    list.append(ob);
    list.preppend(ob);
    and so on...
    sorry I can't post any code here
    hope I could up help you enough,
    good luck

Similar Threads

  1. Circular Double Linked List
    By theonly in forum Advanced Java
    Replies: 3
    Last Post: 12-06-2009, 05:10 PM
  2. Linked List help
    By neobie in forum New To Java
    Replies: 8
    Last Post: 12-22-2007, 03:15 AM
  3. linked list nodes all refernce same item.
    By yllawwally in forum New To Java
    Replies: 0
    Last Post: 12-18-2007, 08:45 PM
  4. going from vectors to linked list?
    By cbrown08 in forum New To Java
    Replies: 3
    Last Post: 12-01-2007, 12:55 AM
  5. Linked List
    By rnavarro9 in forum New To Java
    Replies: 0
    Last Post: 11-29-2007, 03:42 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
  •