Discussion Forum : Searching And Modifying A String
Question -


What is the output of this program?


class output {
public static void main(String args[])
{
String s1 = "one";
String s2 = s1 + " two";
System.out.println(s2);
}
}
Options:
A .  one
B .  two
C .  one two
D .  compilation error
Answer: Option C

None.
Output:
$ javac output.java
$ java output
one two




Was this answer helpful ?
Next Question
Submit Your Solution hear:

Your email address will not be published. Required fields are marked *