Objects, Immutability, and Switch Expressions

This chapter includes 18 problems that involve objects, immutability, and switch expressions. The chapter starts with several problems about dealing with null references. It continues with problems regarding checking indexes, equals() and hashCode(), and immutability (for example, writing immutable classes and passing/returning mutable objects from immutable classes). The last part of the chapter deals with cloning objects and the JDK 12 switch expressions. By the end of this chapter, you will have a fundamental knowledge of objects and immutability. Moreover, you will know how to deal with the new switch expressions. These are valuable and non-optional bits of knowledge in any Java developer's arsenal.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.2.240