Calculate Square

Report a typo

You need to implement the calculateSquare method.

It should output the square of the element by the provided index of an array. In the case when the exception might happen, your program output should be: Exception!

Write a program in Java 17
class FixingExceptions {

public static void calculateSquare(int[] array, int index) {
// write your code here

}
}
___

Create a free account to access the full topic