R

Ram Sharma • 3.40K Points
Extraordinary

Q. What is the output of: System.out.println(10 + 20 + "30")?

Code:
System.out.println(10 + 20 + "30");
  • (A) 102030
  • (B) 30
  • (C) 3030
  • (D) 3030
  • Correct Answer - Option(D)
  • Views: 5
  • Filed under category Java
  • Hashtags:

Explanation by: Ram Sharma
10 + 20 = 30, then "30" gets concatenated, resulting in "3030".

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.