R

Ram Sharma • 3.40K Points
Extraordinary

Q. What will be the output of this code?

Code:
System.out.println(3 + 4 + "Hello" + 5 + 6);
  • (A) 7Hello56
  • (B) Hello3456
  • (C) 34Hello56
  • (D) 7Hello11
  • Correct Answer - Option(A)
  • Views: 12
  • Filed under category Java
  • Hashtags:

Explanation by: Ram Sharma
3 + 4 = 7; then it becomes 7 + "Hello" → "7Hello" + 5 → "7Hello5" + 6 → "7Hello56"

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.