Question: I need help writing a java method goes over every single row and column of a 2d array (4*4) (nested FOR loop) and checks where

I need help writing a java method goes over every single row and column of a 2d array (4*4) (nested FOR loop) and checks where the given tile number is located in the array. As soon as it finds its location, it creates an integer array, place the row and column into that array and returns it. Hint: The following line of code shows how to create and return an integer array with two numbers

 return new int[]{number1, number2} 

assume the inputs are the 4*4 2d array and the number selected in the array that will be searched

what's returned is an integer array containing the row and column values of the tile location in the board.

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!