fork download
  1. class Practice
  2. {
  3.  
  4. Node head;
  5.  
  6. static class Node
  7. {
  8. int data;
  9. Node next;
  10.  
  11. Node(int d) //constructer
  12. {
  13. data=d;
  14. next=null;
  15. }
  16.  
  17. }
  18.  
  19. public static void main(String args[])
  20. {
  21. Practice llist = new Practice();
  22. llist.head = new Node(1);
  23. Node second = new Node(2);
  24. Node third = new Node(3);
  25.  
  26. llist.head.next= second;
  27.  
  28. second.next=third;
  29.  
  30. System.out.println(llist);
  31.  
  32. }
  33. }
Success #stdin #stdout 0.04s 2184192KB
stdin
Standard input is empty
stdout
Practice@677327b6