Evyatar12

Class

Nov 28th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Nodes
  8. {
  9. class Class
  10. {
  11. private Node<Student> students;
  12.  
  13. public Class(Node<Student> students)
  14. {
  15. this.students = students;
  16. }
  17.  
  18. public Node<Student> getStudents()
  19. {
  20. return this.students;
  21. }
  22.  
  23. private Node<Student> current;
  24.  
  25. public void addSubject(Student student)
  26. {
  27. Node<Student> t = new Node<Student>(student);
  28.  
  29. if (this.students == null)
  30. {
  31. this.students = t;
  32.  
  33. }
  34. else
  35. {
  36. this.current.setNext(t);
  37. }
  38.  
  39. this.current = t;
  40. }
  41. }
  42. }
Add Comment
Please, Sign In to add comment