Task 1: Exception handling
public class Test
{
public static void main(String args[]){
int d =
0;
int n =
20;
int fraction = n/d;
System.out.println("End
Of Main");
}
}
public class Test
{
public static void main(String args[])
{
int d =
0;
int n =
20;
try {
int fraction = n / d;
System.out.println("This
line will not be Executed");
} catch (ArithmeticException e)
{
System.out.println("In
the catch Block due to Exception = " + e);
}
System.out.println("End
Of Main");
}
}
Task 1: Exception handling public class Test { public static void main(String args[]){ int d = 0; int n = 20; int fracti
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Task 1: Exception handling public class Test { public static void main(String args[]){ int d = 0; int n = 20; int fracti
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!