Discussion Forum : Introduction To Methods And Streams
Question -

What will s2 contain after following lines of code?
StringBuffer s1 = “one”;
StringBuffer s2 = s1.append(“two”)

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

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



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

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