Question: Name the new class as FindSmallestValues create a method with the following header to return an array of integer values which are the smallest values

  1. Name the new class as FindSmallestValues
  2. create a method with the following header to return an array of integer values which are the smallest values of each row of a 2D array of integer values

 

public static int[] smallestValues(int[][] num)

 

For example, if the 2D array passed to the method is:

 

8 5 2 6 6 

3 6 5 4 5 

7 5 4 5 0 

8 8 5 1 6

 

The method returns an array of integers which are the smallest values from each row as follows:

 

2

3

0

1

3. In the main method, create a 2D array of integer values with the array size 4 by 5 and invoke the method to find and display the smallest values from each row of the 2D array. 

 

Generate the values of the 2D array using the Math.random() method with the range from 0 to 9.

Step by Step Solution

3.41 Rating (151 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Below Code is implemented as per above description and working properlyPle... View full answer

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 Programming Questions!