Calling a Non-void Method

AP Computer Science A· difficulty 4/5

<code>" hello ".trim().toUpperCase()</code> returns

  • A

    HELLO

    check_circle
  • B

    HELLO

  • C

    hello

  • D

    hello

Explanation

<code>trim()</code> removes whitespace; <code>toUpperCase()</code> then capitalizes → "HELLO".

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

Related questions