AP Computer Science Amediummcq1 pt
Which initialization causes a compile error?
A.int[] a = {1, 2.5};
B.int[] a = {1, 2};
C.int[] a = new int[2];
D.double[] d = {1.5, 2.5};
A double cannot fit an int array.
Aint[] a = {1, 2.5};
Practice more AP Computer Science A questions with full explanations
Practice Unit 6: Array Questions →