Computer Science, asked by thipparthisarala, 10 months ago

which of the following is an incorrect array declaration?
a) int[] a = new int[20];
b)int [] a;
c)int [] [] a = new int[20];
d)int [] [] a = { {1,2,4},{1,2,4}};

Answers

Answered by hapsechaitanya
7

Answer:

a is correct .

I think so

Answered by codiepienagoya
2

Array declaration:

The incorrect is "Option C"

Explanation:

  • As we know that Array is a collection of homogeneous elements, and it is divided into two parts that are 1D and 2D. In the given question "Option c" is incorrect because there is a 2D array "a" is declared, and the size of the array is 20, that's is wrong because the 2D array is a collection of row and column, other choices were correct, which can be described as follows:
  • In option a, A 1D array "a" is declared, that's size is 20.
  • In option b, An array "a" is declared.
  • In option d, the 2D array "a" is initialized with elements.

Learn more:

  • Array declaration: https://brainly.in/question/9028012
Similar questions