A

Admin • 825.56K Points
Coach

Q. Which of the following arrays is correctly initialized with values?

  • (A) int[] a = new int[3]{1,2,3};
  • (B) int a[] = {1,2,3};
  • (C) int a[3] = {1,2,3};
  • (D) int a() = new int[]{1,2,3};

Explanation by: Admin
Only option B is valid syntax for array declaration with initialization.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.