import org.pureprogrammer.Utils; public class Exceptions2 { public static void main(String[] args) { int i = 0; double d = 0; try { i = Integer.parseInt(args[0]); } catch (Exception ex) { System.out.println("Can't convert to integer!"); System.exit(1); } try { d = Double.parseDouble(args[1]); } catch (Exception ex) { System.out.println("Can't convert to floating point!"); System.exit(1); } System.out.println(Utils.format("i + d = {0:f}", i + d)); } }