fork(1) 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. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. System.out.println("Enter a value: ");
  13. Scanner input = new Scanner(System.in);
  14. double a = input.next();
  15. System.out.println(a);
  16. double b = nextByte();
  17. System.out.println(b);
  18. double c = input.nextShort();
  19. System.out.println(c);
  20. double d = nextLong();
  21. System.out.println(d);
  22. double e = input.nextFloat();
  23. System.out.println(e);
  24. double f = input.nextDouble();
  25. System.out.println(f);
  26. double g = input.nextBoolean();
  27. System.out.println(g);
  28.  
  29. }
  30. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:14: error: incompatible types: String cannot be converted to double
		   double a = input.next();
		                        ^
Main.java:16: error: cannot find symbol
		   double b = nextByte();
		              ^
  symbol:   method nextByte()
  location: class Ideone
Main.java:20: error: cannot find symbol
		   double d = nextLong();
		              ^
  symbol:   method nextLong()
  location: class Ideone
Main.java:26: error: incompatible types: boolean cannot be converted to double
		   double g = input.nextBoolean();
		                               ^
4 errors
stdout
Standard output is empty