Home  >  Article  >  Java  >  10 recommended courses on string operations

10 recommended courses on string operations

巴扎黑
巴扎黑Original
2017-06-15 15:22:241206browse

1. String class The value of String is immutable, which results in each operation on String generating a new String object, which is not only inefficient, but also wastes a lot of limited memory space. String a = "a"; //Assume a points to address 0x0001 a = "b"; //After reassignment, a points to address 0x0002, but the "a" saved in address 0x0001 still exists, but it is no longer pointed to by a. Of, a already points to other addresses. Therefore, String operations are all operations of changing the assignment address rather than changing the value. 2. StringBuffer is a mutable class and a thread-safe string operation class. Any operation on the string it points to will not create a new object. Each StringBuffer object has a certain buffer capacity. When the string size does not exceed the capacity, new capacity will not be allocated. When the string size exceeds the capacity, the capacity will be automatically increased. &nb

1. Comprehensive explanation of the relationship between StringBuilder, StringBuffer, and String classes in java

10 recommended courses on string operations

Introduction: The value of String is immutable, which results in a new String object being generated every time an operation is performed on String. This is not only inefficient, but also wastes a lot of limited memory space. StringBuffer can Variable class, and thread-safe string operation class, any operation on the string it points to will not generate a new object. The functions of StringBuffer and StringBuilder classes are basically similar

2. Commonly used tool classes in java are string manipulation classes and MD5 encryption and decryption classes

10 recommended courses on string operations

Introduction: This article mainly introduces the string operation class and MD5 encryption and decryption class commonly used in Java. Friends in need can refer to

[Related Q&A recommendations]:

The above is the detailed content of 10 recommended courses on string operations. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn