Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    May 2004
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Basic Java Issue (linked lists)

    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. e: giggs11mufc@hotmail.com cheers guys hoping someone can save me....

  • #2
    New Coder
    Join Date
    Jun 2003
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts
    hi everyone,,,
    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:
    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:
    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

  • #3
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,273
    Thanks
    4
    Thanked 83 Times in 82 Posts
    This smells just like a homework assignment. In school students typically learn about linked lists as part of a data structures course. I know I did in college. If that is the case you need to do the coding yourself. We will not write it for you nor show you where to find it. That would be helping you cheat.

    You can however ask specific questions and we will try to answer them and guide you in the right direction.
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster


  •  

    Posting Permissions

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