![]() |
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....
|
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 |
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. |
| All times are GMT +1. The time now is 12:27 PM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.