Ask Question

The following statement creates alpha to be a two-dimensional array of 35 components.

int[][] alpha = new int[20][15];

A) True

B) False

+1
Answers (1)
  1. 6 May, 08:16
    0
    B) False.

    Explanation:

    int[][] alpha = new int[20][15];

    This statement will create and array with 20 rows and 15 columns. So the number of elements this array can accommodate is 20*15=300. So this array can hold more than 35 elements so the statement is false.

    To have an array which can hold 35 we need an array of 7 rows and 5 columns or with 5 rows or 7 columns.

    int [][] alpha = new int[7][5];

    or int [][] alpha = new int[5][7];
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “The following statement creates alpha to be a two-dimensional array of 35 components. int[][] alpha = new int[20][15]; A) True B) False ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers