String Objects: Concatenation, Literals, and More

AP Computer Science A· difficulty 3/5

What does <code>"Sum = " + (3 + 4)</code> produce?

  • A

    Sum = 7

    check_circle
  • B

    Sum = 34

  • C

    Compile error

  • D

    Sum = (3 + 4)

Explanation

Parentheses force numeric addition first.

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

Related questions