II B.Tech II Sem CSE Java Lab Exercise - 7b (Exception)

b) Illustrating multiple catch classes

Aim:To write a JAVA program Illustrating Multiple catch clauses

Description:


Program:

class multitrydemo 
{
public static void main(String args[]) 
{
try 
{
int a=10,b=5; 
int c=a/b;
int d[]={0,1}; 
System.out.println(d[10]); 
System.out.println(c);
}
catch(ArithmeticException e) 
{
System.out.println(e); 
}
catch(ArrayIndexOutOfBoundsException e) 
{
System.out.println(e); 
}
System.out.println("After the catch statement");
}
}

Output:


No comments

File Uploading in PHP

  File Uploading in PHP PHP allow you to upload any type of a file i.e. image, binary or text files.etc..,PHP has one in built global variab...