fork download
  1. public class Dentaku {
  2. public static Double Add(Double n1, Double n2) {
  3. return n1 + n2;
  4. }
  5.  
  6. public static Double Sub(Double n1, Double n2) {
  7. return n1 - n2;
  8. }
  9.  
  10. public static Double Mul(Double n1, Double n2) {
  11. return n1 * n2;
  12. }
  13.  
  14. public static Double Div(Double n1, Double n2) throws Exception {
  15. if (n2.equals(0.0)) {
  16. throw new Exception("DIV NaN");
  17. }
  18.  
  19. return n1 / n2;
  20. }
  21.  
  22. public static Double Mod(Double n1, Double n2) throws Exception {
  23. if (n2.equals(0.0)) {
  24. throw new Exception("MOD NaN");
  25. }
  26.  
  27. return n1 % n2;
  28. }
  29. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:1: error: class Dentaku is public, should be declared in a file named Dentaku.java
public class Dentaku {
       ^
1 error
stdout
Standard output is empty