public class Node<C> {
private C data;
private Node<C> next;
public Node(C the_data){
data=the_data;
next=null;
}
public C getData(){
return data;
}
public void setNext(Node<C> theNext){
next=theNext;
}
public Node<C> getNext(){
return next;
}
public void print(){
System.out.println(data.toString());
}
public static void main(String args[]){
Node<String> list=null;
for (int i=0; i<args.length; i++){
Node<String> node=
new Node<String>(args[i]);
node.next=list;
list=node;
}
for (Node<String> n=list ; n!=null ;
n=n.next){
System.out.println(n.data);
}
}
}