Win a copy of Java EE 8 High Performance this week in the Java/Jakarta EE forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Linked list Help  RSS feed

Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I need to create a notepad program, which is essentially a linked list of nodes, where each node is a linked list of nodes. The "inner" list is for storing a "note" (each line of the note will be stored in a node of this list and can be either a String or an Integer). The "outer" is a list of these notes. I have to make a generic class, so I have the G<T> class for the Object data, GNode<T> class for the node, GList<T> class for the list, and my MyMain class for the main method.
Below are the classes. I am not sure how to go about this!! How do I store a string or integer as a node and keep it as a linked list within a linked list? I know I have a printList and setEntry compiling error in my main method (the only errors so far), and I would like help with that, but more with the actual concept and how to go about it. I may not need to fix those errors if they are not needed the way I wrote them. This is as far as I've gotten.

---------------------------------------------------------The MyMain Class

---------------------------------------------------------The GList<T> Class

---------------------------------------------------------The GNode<T> Class

---------------------------------------------------------The G<T> Class

[Edit: put code between [code] and [/code] ubb code blocks]
No matter how many women are assigned to the project, a pregnancy takes nine months. Much longer than this tiny ad:
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!