Get Started
4334

Q: What is the string contained in s after following lines of code? StringBuffer s = new StringBuffer(“Hello”); s.deleteCharAt(0);  ?

  • 1
    llo
  • 2
    Hllo
  • 3
    ello
  • 4
    H
  • उत्तर देखें
  • Workspace

Answer : 3. "ello"
Explanation :

Answer: C) ello Explanation: deleteCharAt() method deletes the character at the specified index location and returns the resulting StringBuffer object. So after deleting the character at 0 ie 'H', the string returns 'ello' as the output.

सबसे विस्तृत एग्जाम तैयारी प्लेटफार्म

Examsbook Prep ऐप आज ही प्राप्त करें