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

  • SEARCH
  • Home
  • 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 8194639
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T04:53:25+00:00 2026-06-07T04:53:25+00:00

I’ve read multiple places that in Java 1.5+ String concatenations are optimized to using

  • 0

I’ve read multiple places that in Java 1.5+ String concatenations are optimized to using a StringBuilder when a program is compiled. It’s unclear to me if this is a standard or just a common optimization many compilers employ. Any clarificion in regards to this would be appreciated, but mainly it’s a lead-in to my second question.

Does .NET similarly optimize? I’m aware that if I use StringBuilder this will eliminate any ambiguity but I personally find the simplicity of + easier to read. If .NET does, did this start in a specific version? Elaboration is appreciated.

  • 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-07T04:53:26+00:00Added an answer on June 7, 2026 at 4:53 am

    Hope this will give you a better view towards StringBuilder then string conctenation with +

    Performance Considerations

    A String object concatenation operation always creates a new object
    from the existing string and the new data. A StringBuilder object
    maintains a buffer to accommodate the concatenation of new data. New
    data is appended to the buffer if room is available; otherwise, a new,
    larger buffer is allocated, data from the original buffer is copied to
    the new buffer, and the new data is appended to the new buffer.

    The performance of a concatenation operation for a String or StringBuilder object depends on the frequency of memory allocations. A
    String concatenation operation always allocates memory, whereas a
    StringBuilder concatenation operation allocates memory only if the
    StringBuilder object buffer is too small to accommodate the new data.
    Use the String class if you are concatenating a fixed number of String
    objects. In that case, the compiler may even combine individual
    concatenation operations into a single operation. Use a StringBuilder
    object if you are concatenating an arbitrary number of strings; for
    example, if you’re using a loop to concatenate a random number of
    strings of user input.

    MSDN

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
I've got a string that has curly quotes in it. I'd like to replace
Does anyone know how can I replace this 2 symbol below from the string
I have thousands of HTML files to process using Groovy/Java and I need to
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string

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.