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 "
  13. + e.getMessage()
  14. , e);
  15. }
  16. }
  17. }
Runtime error #stdin #stdout #stderr 0.12s 51940KB
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:13)
	at Ideone.main(Main.java:4)
Caused by: java.lang.ArithmeticException: divide by 0
	at Ideone.calculateX(Main.java:9)
	... 1 more