Answers for "Give a 2D array table, wrote the code that sets the cell at row 4 and column 7 to be 15. Assume 4 and 7 are valid row and column indices for the table. You can also assume that table was declared. Do not put any empty spaces unless they are necessary."

1

Index through 2d array

int[][]x;//define
for(int i=0;i<x.length;i++){
  for(int j=0;j<x[i].length;j++){
    //dp something with x[i][j]
  }
}
Posted by: Guest on November-07-2020
1

Index through 2d array

int[][]x;//define
for(int []y:x){
  for(int a:y){
    //do something with a
  }
}
Posted by: Guest on November-07-2020

Code answers related to "Give a 2D array table, wrote the code that sets the cell at row 4 and column 7 to be 15. Assume 4 and 7 are valid row and column indices for the table. You can also assume that table was declared. Do not put any empty spaces unless they are necessary."

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language