Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Nodes
- {
- class Student
- {
- public int ID { get; }
- private Node<Subject> subjects;
- public Student(int ID, Node<Subject> subjects)
- {
- this.ID = ID;
- this.subjects = subjects;
- }
- public Node<Subject> getSubjects()
- {
- return this.subjects;
- }
- private Node<Subject> current;
- public void addSubject(Subject subject)
- {
- Node<Subject> t = new Node<Subject>(subject);
- if (this.subjects == null)
- {
- this.subjects = t;
- }
- else
- {
- this.current.setNext(t);
- }
- this.current = t;
- }
- }
- }
Add Comment
Please, Sign In to add comment