Task 3: Try Catch
public class Test
{
public static void main(String args[]){
int [] num= new int [5]; //Array
of 5 elements is made
num[9] = 5; // set the
9th element to the value 5
} }
public class Test
{
public static void main(String args[]){
int [] num= new int [5]; //Array
of 5 elements is made
……….. {
System.out.println("before");
…………// set the 9th element to the value 5
System.out.println("after");
}
……………..(………………………. e){
System.out.println("inside
the catch");
}
} }
Task 3: Try Catch public class Test { public static void main(String args[]){ int [] num= new int [5]; //Array of 5 elem
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Task 3: Try Catch public class Test { public static void main(String args[]){ int [] num= new int [5]; //Array of 5 elem
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!