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. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. Double d = Math.round(100.675 * 100)/100;
  13. Double e = Math.round(100.150*100)/100;
  14. Float f = Math.round(100f*100)/100;
  15. Float g = Math.round(90f*100)/100;
  16.  
  17.  
  18.  
  19. System.out.println(d);
  20. System.out.println(e);
  21. System.out.println(f);
  22. System.out.println(g);
  23. }
  24. }
Compilation error #stdin compilation error #stdout 0.06s 32988KB
stdin
Standard input is empty
compilation info
Main.java:12: error: incompatible types: long cannot be converted to Double
		Double d = Math.round(100.675 * 100)/100;
		                                    ^
Main.java:13: error: incompatible types: long cannot be converted to Double
      Double e = Math.round(100.150*100)/100;
                                        ^
Main.java:14: error: incompatible types: int cannot be converted to Float
      Float f = Math.round(100f*100)/100;
                                    ^
Main.java:15: error: incompatible types: int cannot be converted to Float
      Float g = Math.round(90f*100)/100;
                                   ^
4 errors
stdout
Standard output is empty