Home / CSE MCQs / JAVA MCQs :: Discussion

Discussion :: JAVA MCQs

  1. What is the string contained in s after following lines of code?

     StringBuffer s new StringBuffer("Hello);

     s.deleteCharAt(0);

  2. A.
    Hell
    B.
    ello
    C.
    Hel
    D.
    llo

    View Answer

    Workspace

    Answer : Option B

    Explanation :

    deleteCharAt() method deletes the character at the specified index location and returns the resulting StringBuffer object.


Be The First To Comment