This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Trying to learn link list  RSS feed

 
Yafet Negussie
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I'm trying to learn link lists. I understand the general concept, but I'm having difficulties implementing simple singly linked list. Here is the code so far, but it doesn't compile... I appreciate any explanations of what I'm doing wrong and how the code is supposed to be implemented.

 
Junilu Lacar
Sheriff
Posts: 10879
158
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Next time, you should post the compiler error message as well; that will help folks help you. On Line 15, you are trying to instantiate a Node with a no-argument constructor. However, as you have written Node, it doesn't have a no-argument constructor.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!