static void Main(string[] args) { node mynode = new node("A"); mynode.next = new node("1"); mynode.next.next = new node("B"); mynode.next.next.next = new node("2"); // Console.WriteLine(mynode.next.next.data); // access mynode.print(); Console.WriteLine("__________________________________________\a"); mynode.append("C"); mynode.append("3"); mynode.print(); }
public void print() { Console.WriteLine(data); if (next != null) { next.print(); } }