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

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
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

Post 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");
}
} }
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply