Exception handling in Java Program
Exception handling
import java.io.*;
class ExceptEg
{
Static int a,b,c,d;
public Static void main(String args[]) throws IOException
{
try
{
int art[]=new int[2];
int art[3]=45;
System.out.println("Welcome");
}
catch(ArrayIndexOutOfBoundsException ae)
{
System.out.println(ae);
}
/*try
{
Buffered Reader br= new BufferedReader(new InputStreamReader(System.in));
a=Integer.parseInt(br.readLine());
b=Integer.parseInt(br.readLine());
c=a/b;
System.out.println(c);
}
catch(Arithemetic Exception e)
{
System.out.println(e);
}*/
}
}
0 coment�rios:
Post a Comment