Question: How to return the 2d array The code below is made up 2d array that is taking in two 1d arrays public int speedNAngels( int

How to return the 2d array

The code below is made up 2d array that is taking in two 1d arrays

public int speedNAngels( int [] speedsArray, int numOfSpeed, int [] angelsArray, int numOfAngels) {

int [][] speedAngels = new int [numOfSpeed][numOfAngels];

int row =0;

int col =0;

for(row =0; row < speedsArray.length; row++){

speedAngels[row][0] = speedsArray[row];

}

for(col =0; col < angelsArray.length; col++ ){

speedAngels[col][1] = angelsArray[col];

}

// string result = speedAngels[i][0]+" "+speedAngels[i][1];

return;

}

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!