A

Admin • 802.91K Points
Coach

Q. What is the result of:
String s = null;
s += "Java";
System.out.println(s);

  • (A) Java
  • (B) nullJava
  • (C) null
  • (D) Runtime error

Explanation by: Admin
s is null, so when concatenated with "Java" using +=, it becomes "nullJava".

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.