Discussion Forum : Searching And Modifying A String
Question -

What will s2 contain after following lines of code?
String s1 = "one";
String s2 = s1.concat("two")

Options:
A .  one
B .  two
C .  onetwo
D .  twoone
Answer: Option C

Two strings can be concatenated by using concat() method.


Was this answer helpful ?
Submit Your Solution hear:

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