Array Creation and Access

AP Computer Science A· difficulty 3/5

For <code>int[] arr = new int[3];</code>, the values of the elements are

  • A

    Random

  • B

    All null

  • C

    All 0

    check_circle
  • D

    Garbage from memory

Explanation

int arrays default to 0; double arrays to 0.0; boolean to false; reference to null.

Want 10 more like this — adaptive to your weak spots?

Related questions