Java Learning Note (ii)-------String,stringbuffer,stringbuilder differences and mappings to synchronous, asynchronous-related knowledge

Source: Internet
Author: User

1. String is an immutable class that changes the value in a string variable, which is equivalent to opening up new space for storing a new string variable

2. StringBuffer variable class, can change the value of the variable through the Append method, and StringBuffer is thread-safe, many of its methods are synchronous method, support concurrent operation, suitable for multithreading

3. StringBuilder variable class, but thread insecure, for single-threaded performance higher than stringbuffer

4. HashTable thread-safe, hashmap thread unsafe

5. So what is synchronization and what is asynchronous

Synchronization: A sent past a request, need to receive a response from the receiver B, a can proceed to the next step, otherwise wait

Async: A sends a past request, whether or not received a reply from B, a will continue to do the following things, and do not wait.

Java Learning Note (ii)-------String,stringbuffer,stringbuilder differences and mappings to synchronous, asynchronous-related knowledge

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.