fork(3) download
  1. class Ideone
  2. {
  3. public static void main (String[] args) throws java.lang.Exception
  4. {
  5. try {
  6. Integer.parseInt(null); // throws java.lang.NumberFormatException: null
  7. }
  8. catch (Exception e) {
  9. System.out.println("Integer: " + e.getClass().getName());
  10. }
  11. try {
  12. Double.parseDouble(null); // throws java.lang.NullPointerException
  13. }
  14. catch (Exception e) {
  15. System.out.println("Double: " + e.getClass().getName());
  16. }
  17. }
  18. }
Success #stdin #stdout 0.07s 380224KB
stdin
Standard input is empty
stdout
Integer: java.lang.NumberFormatException
Double: java.lang.NullPointerException