fork download
  1. class Ideone {
  2. public static void main(String[] args) {
  3. int x = 10;
  4. calculateX(x);
  5. }
  6.  
  7. private static void calculateX(int x) {
  8. try {
  9. throw new ArithmeticException("" +
  10. "divide by 0");
  11. } catch (Exception e) {
  12. throw new RuntimeException("Run time error " + e.getMessage()
  13. , e);
  14. }
  15. }
  16. }
Runtime error #stdin #stdout #stderr 0.1s 50268KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Exception in thread "main" java.lang.RuntimeException: Run time error divide by 0
	at Ideone.calculateX(Main.java:12)
	at Ideone.main(Main.java:4)
Caused by: java.lang.ArithmeticException: divide by 0
	at Ideone.calculateX(Main.java:9)
	... 1 more