Array Creation and Access

AP Computer Science A· difficulty 4/5

<code>System.out.println(arr)</code> (where arr is int[]) prints

  • A

    A hash-like reference '[I@...'

    check_circle
  • B

    Compile error

  • C

    The length

  • D

    The array contents

Explanation

Default array <code>toString</code> shows class name + hash; use <code>Arrays.toString</code>.

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

Related questions