Exception Handling in Java with Examples

Exception Handling in Java with Examples

Exception Handling in Java with Examples


exception handling in java with examples,how to handle null pointer exception in java,exception handling in c++ and java,exception handling in java interview questions and answers for experienced,handling null pointer exception in java 8


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);
}*/
}
}


Post a Comment

0 Comments