Multiple Choice Question

Quiz Guidelines



Given the following code :

public class TestClass {    
int[][] matrix = new int[2][3];       
 int a[] = {1, 2, 3};  
  int b[] = {4, 5, 6};               
 public int compute(int x, int y){        //1 : Insert Line of Code here  
public void loadMatrix(){        
for(int x=0; x<matrix.length; x++){          
  for(int y=0; y<matrix[x].length; y++){                //2: Insert Line of Code here         
   }        }    } } 

What can be inserted at //1 and //2?

Select 1 option 

A. return a(x)*b(y); and matrix(x, y) = compute(x, y); 
B. return a[x]*b[y]; and matrix[x, y] = compute(x, y);
C. return a[x]*b[y]; and matrix[x][y] = compute(x, y); 
D. return a(x)*b(y); and matrix(x)(y) = compute(x, y); 
E. return a[x]*b[y]; and matrix[[x][y]] = compute(x, y); 

Q&A Set: 

Search the Web

Custom Search

Searches whole web. Use the search in the right sidebar to search only within!!!