Exception Handling

  • Uploaded by: Omar Farooq
  • 0
  • 0
  • November 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Exception Handling as PDF for free.

More details

  • Words: 42
  • Pages: 1
EXCEPTION HANDLING PROGRAM: class sample { public static void main(Strig str[]) { int sum=0; System.out.println("the command line argument is "); for(int i=0;i<str.length;i++) System.out.println(str[i]+" "); try { for(int i=0;i<str.length;i++) sum=sum+Integer.parseInt(str[i]); System.out.println("the sum is"+sum); } catch(NumberFormatException e) { System.out.println(e.getMessage()); } System.out.println("Program terminatiom"); } }

Related Documents

Exception Handling
November 2019 33
Exception Handling
November 2019 36
Exception Handling
June 2020 26
Exception Handling
June 2020 22

More Documents from ""