3
Q:

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

StringBuffer s = new StringBuffer(“Hello”); s.deleteCharAt(0);  ?

A) llo B) Hllo
C) ello D) H

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.

Subject: Java
Job Role: Analyst , IT Trainer
Q:

What is the most important feature of Java?

Answer Java is a platform independent language.
Report Error

View answer Workspace Report Error Discuss

Subject: Java

0 3215