Home » JAVA Programming » Strings » Question
  1. What will s2 contain after following lines of code?

    String str1 = "one";
    String str2 = str1.concat("two")
    1. onetwo
    2. twoone
    3. one
    4. two
    5. None of these
Correct Option: A

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



Your comments will be displayed only after manual approval.