fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {public void insert (T val) {
  10. Node<T> tmp;
  11. if (empty()){//If list is empty
  12. current = head = new Node<T> (val);
  13. }
  14. else {
  15. tmp = current.next;
  16. current.next = new Node<T> (val);
  17. current = current.next;
  18. current.next = tmp;}
  19. }
  20. public static void main (String[] args) throws java.lang.Exception
  21. {
  22. // your code goes here
  23. }
  24. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:9: error: cannot find symbol
{public void insert (T val) {
                     ^
  symbol:   class T
  location: class Ideone
Main.java:10: error: cannot find symbol
	Node<T> tmp;
	^
  symbol:   class Node
  location: class Ideone
Main.java:10: error: cannot find symbol
	Node<T> tmp;
	     ^
  symbol:   class T
  location: class Ideone
Main.java:11: error: cannot find symbol
     if (empty()){//If list is empty
         ^
  symbol:   method empty()
  location: class Ideone
Main.java:12: error: cannot find symbol
     	current = head = new Node<T> (val);
     	^
  symbol:   variable current
  location: class Ideone
Main.java:12: error: cannot find symbol
     	current = head = new Node<T> (val);
     	          ^
  symbol:   variable head
  location: class Ideone
Main.java:12: error: cannot find symbol
     	current = head = new Node<T> (val);
     	                     ^
  symbol:   class Node
  location: class Ideone
Main.java:12: error: cannot find symbol
     	current = head = new Node<T> (val);
     	                          ^
  symbol:   class T
  location: class Ideone
Main.java:15: error: cannot find symbol
	   tmp = current.next;
	         ^
  symbol:   variable current
  location: class Ideone
Main.java:16: error: cannot find symbol
	   current.next = new Node<T> (val);
	   ^
  symbol:   variable current
  location: class Ideone
Main.java:16: error: cannot find symbol
	   current.next = new Node<T> (val);
	                      ^
  symbol:   class Node
  location: class Ideone
Main.java:16: error: cannot find symbol
	   current.next = new Node<T> (val);
	                           ^
  symbol:   class T
  location: class Ideone
Main.java:17: error: cannot find symbol
	   current = current.next;
	   ^
  symbol:   variable current
  location: class Ideone
Main.java:17: error: cannot find symbol
	   current = current.next;
	             ^
  symbol:   variable current
  location: class Ideone
Main.java:18: error: cannot find symbol
	   current.next = tmp;}
	   ^
  symbol:   variable current
  location: class Ideone
15 errors
stdout
Standard output is empty