Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8167779
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T20:18:29+00:00 2026-06-06T20:18:29+00:00

Possible Duplicate: String, StringBuffer, and StringBuilder We know that String are immutable where StringBuffer

  • 0

Possible Duplicate:
String, StringBuffer, and StringBuilder

We know that String are immutable where StringBuffer/StringBuilder are mutable. But sometimes we get confused what to use in our code.. the String or StringBuffer/StringBuilder ?? Practically in our maximum code/quick code we use to prefer String than StringBuffer/StringBuilder.

This question is to solve the confusion, if you have any idea & proper reason for that, then please give a reply.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T20:18:30+00:00Added an answer on June 6, 2026 at 8:18 pm

    Below is the main difference between these three most commonly used classes.

    • String class objects are immutable whereas StringBuffer and
      StringBuilder objects are mutable.
    • StringBuffer is synchronized while StringBuilder is not synchronized.
    • Concatenation operator “+” is internal implemented using either
      StringBuffer or StringBuilder.

    Criteria to choose among String, StringBuffer and StringBuilder

    • If the Object value is not going to change use String Class because a
      String object is immutable.
    • If the Object value can change and will only be accessed from a
      single thread, use a StringBuilder because StringBuilder is
      unsynchronized.
    • In case the Object value can change, and will be modified by multiple
      threads, use a StringBuffer because StringBuffer is synchronized.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: String vs StringBuilder i know .NET Strings are immutable which is the
Possible Duplicate: Java String.equals versus == I know it' a dumb question but why
Possible Duplicate: Are string.Equals() and == operator really same? I know that in c#
Possible Duplicate: Why to use StringBuffer in Java instead of the string concatenation operator
Possible Duplicate: String vs StringBuilder I just revisited some of the books that I
Possible Duplicate: String, StringBuffer, and StringBuilder what is the difference (advantages, disadvantages) between using
Possible Duplicate: String comparison in Objective-C I realize that the question is not very
Possible Duplicate: String vs string in C# I know there is no difference between
Possible Duplicate: java String concatenation StringBuilder vs String concatenation in toString() in Java I
Possible Duplicate: C#: String.Equals vs. == Are string.Equals() and == operator really same? sometimes

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.