Page 1 of 1

Task 3: Try Catch public class Test { public static void main(String args[]){ int [] num= new int [5]; //Array of 5 elem

Posted: Sat May 14, 2022 3:34 pm
by answerhappygod
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");
}
} }