class node holds public value of present node and the next address of the sequential node.
printList runs through linked list and prints their value, while n checks the address for the next node value.
main holds all values and address for the linked list and calls the printlist function.