You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
555 B

6 years ago
  1. // The LNode class that represents a node in linked lists
  2. // Do not make any changes to this file!
  3. // Xiwei Wang
  4. public class LNode
  5. {
  6. // instance variables
  7. private int m_info;
  8. private LNode m_link;
  9. // constructor
  10. public LNode(int info)
  11. {
  12. m_info = info;
  13. m_link = null;
  14. }
  15. // member methods
  16. public void setLink(LNode link)
  17. {
  18. m_link = link;
  19. }
  20. public LNode getLink()
  21. {
  22. return m_link;
  23. }
  24. public int getInfo()
  25. {
  26. return m_info;
  27. }
  28. }