Question: P1) Write a Java code to print all elements of even index in A. For example, if you are given, A 15 24 9 0

 P1) Write a Java code to print all elements of even

P1) Write a Java code to print all elements of even index in A. For example, if you are given, A 15 24 9 0 1 2 Your Answer: public static void main(String[] args) { int[] A = {10,15,24,9,45,67,89}; 10 45 67 89 3 4 5 6 You Java code will print 10, 24, 45, 89 Your Answer: P2) Suppose, you are given an array of 6 integer numbers: 15 0 1 2 10 24 45 67 89 A 3 4 5 6 What type of exception (error) will be raised with the following statement? int k = A[7); You need to provide brief explanation for your

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!