A String object is immutable while a StringBuffer object can be changed in place. StringBuffer provides methods such as append, insert, delete and reverse that String does not. Repeated concatenation with String creates a new object each time and is slow, whereas StringBuffer modifies one object and is efficient.
No teacher has reviewed this answer and no independent check has confirmed it, so it may contain mistakes. It is not CISCE's marking scheme.
Step-by-step solution
The step-by-step working and where each mark is earned are part of Board Pass. The question and answer stay free.
Try it
·Full solution
Only on this page: it is kept if you say you got it wrong, so you can compare later.
Board explanation
Watch a teacher solve this on the board, step by step, with voice. Then ask about any step.
AI Examiner
Not available for this question
No checked answer or marking scheme for this question yet.
Its answer has not been reviewed. The AI Examiner marks only questions that have an official marking scheme or an answer a teacher has reviewed.