Guessing from your requirements,it would be better to implement your code through a LinkedList.
http://chaoticjava.com/posts/linkedlist-vs-arraylist/
http://chaoticjava.com/posts/linkedlist-vs-arraylist/
|
Java
Opinion needed - Array List or Linked List |
|
Guessing from your requirements,it would be better to implement your code through a LinkedList.
http://chaoticjava.com/posts/linkedlist-vs-arraylist/
Well,to take in lots of input,create a class CD like this as suggested by SoFlawLess_:
Code public class CD{Then create an ArrayList or LinkedList in your main class by the name say,cdList by writing it like: Code ArrayList<CD> cdList=new ArrayList<CD>();Then,the function to add to the list will be something like: Code public static insertToList(String artist,String name,String date){(Jun 30, 2012 11:02 AM)node.js Wrote: See that's the problem. Do something like this:Reveal the behavior through an interface (for example, List<?>) rather than implementation (ArrayList<?>) Also, I believe an array list is the better choice. |
|
|
| Possibly Related Threads... | |||
| Thread / Author | Replies | Views | Last Post |
| [C] by gurlhackerclubMay 19, 2020 05:18 PM | 8 | 260 |
May 19, 2020 05:18 PM Last Post: k1r3n |
| [Java] by Juice.Mar 10, 2020 07:02 PM | 0 | 136 |
Mar 10, 2020 07:02 PM Last Post: Juice. |
| [C] by g4143Dec 28, 2019 09:24 AM | 1 | 351 |
Dec 28, 2019 09:24 AM Last Post: an balker |