Question: A. Refer to the following array declaration: int list [][]={{7, 6}, {11, 4}}; Write a static method that accepts the two-dimensional array as the argument.

A. Refer to the following array declaration: int list [][]={{7, 6}, {11, 4}}; Write a static method that accepts the two-dimensional array as the argument. The method sorts the array in ascending order and re-arrange the value as 2 x 2 matrix order. (5M) A sample output if a program prints the array (as a reference only): Note: you are not allowed to use any Java built-in functions (e.g. Arrays.sort(), Collections.sortingOrder() and etc.

B. Modify the following code segment in order to handle the potential exception that might occur. Note: no syntax error in the code segment. i. Use printStackTrace() to display the error. (2.5M) int age = new Scanner(System.in).nextInt(); System.out.println("Age entered is "+age);

ii. Use getMessage() to display the error. (2.5M) int [] array = {5, 1, 3}; int i; for(i=0;i

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!