String Objects
In an effort to analyze every aspect of our Java applications to ensure that they perform at a highly efficient rate, we need to consider string objects. Strings are a big part of Java applications and are used for limitless purposes from a simple list of names to complex data storage needs, such as with a bank’s databases. The creation, manipulation, and management of these objects should be a primary concern.
This chapter focuses on the efficient use of string objects in our Java applications. The first concept is proper string pooling. We will examine this concept and explore best practices for using string pooling for high performance. The chapter also introduces the concept of lazy initialization, examines its benefits, and illustrates implementation with sample code. Lastly, we will look at additional string operation strategies, to include advanced string manipulation techniques.
In this chapter, we will cover the following main topics:
- Proper...