4.7. Summary

In this chapter, you learned about the String class, its properties, and its methods. Because this is one of the most frequently used classes in Java, I’ll reiterate that a good understanding of this class in terms of why its methods behave in a particular manner will go a long way toward helping you successfully complete the OCA Java SE 8 Programmer I exam.

You learned how to initialize String variables using the operator new and the assignment operator (=) with String literals. You also learned the differences between how String objects are stored using these two approaches. If you use the assignment operator to initialize your String variables, they’re stored in a common pool of String objects (also known as the String constant ...

Get OCA Java SE 8 Programmer I Certification Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.