Question PRG-JAVA-0007
EasyWhat is the output of this program?
public class Main {
public static void main(String[] args) {
String s = "Hello " + "World";
System.out.println(s);
}
}
- A.
Hello World
- B.
Hello+World
- C.
Show answer and explanation
Answer: A
- concatenates strings; the space inside "Hello " is kept.