Overriding Methods

AP Computer Science A· difficulty 4/5

Overriding <code>toString()</code> lets you

  • A

    Make object immutable

  • B

    Allow reflection

  • C

    Modify private state

  • D

    Customize how the object prints

    check_circle

Explanation

<code>System.out.println(obj)</code> uses the custom toString.

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

Related questions