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. // your code goes here
  13. fun(4);
  14. }
  15. public double SquareRoot( double value ) throws ArithmeticException
  16. {
  17. if (value >= 0) return Math.sqrt( value );
  18. else throw new ArithmeticException();
  19. }
  20.  
  21. public double func(int x) {
  22. double y = (double) x;
  23. y *= -9.0;
  24. try {
  25. y = SquareRoot( y );
  26. }
  27. catch(ArithmeticException e) { y /= 3; }
  28. finally { y += 10; }
  29. return y;
  30. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
func(9)
compilation info
Main.java:30: error: reached end of file while parsing
}
 ^
1 error
stdout
Standard output is empty