Interviewer And Interviewee Guide

Full Stack Developer (Java) Interview Question:

Explain me what is the difference between String, StringBuffer andStringBuilder?

Submitted by: Muhammad
String is an immutable class. In older JDK's the recommendation when programmatically building a String was to use StringBuffer since this was optimized to concatenate multiple Strings together. However, the methods on StringBuffer were marked as sychronized, which meant that there was a performance penalty, hence StringBuilder was introduced to provide a non-synchronized way to efficiently concatenate and modify Strings.
Submitted by: Muhammad

Read Online Full Stack Developer (Java) Job Interview Questions And Answers
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.