Home / CSE MCQs / JAVA MCQs :: Discussion

Discussion :: JAVA MCQs

  1. What will s2 contain after following lines of code?

     StringBuffer s1 = "one;

     StringBuffer s2 = s1.append("two)

  2. A.
    one
    B.
    two
    C.
    onetwo
    D.
    twoone

    View Answer

    Workspace

    Answer : Option C

    Explanation :

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


Be The First To Comment