
上QQ阅读APP看书,第一时间看更新
Chapter 4. Encapsulation of Data
In this chapter, we will learn the different members of a class in Java 9 and how they are reflected in members of the instances generated from a class. We will work with instance fields, class fields, setters, getters, instance methods, and class methods. We will:
- Understand the members that compose a class in Java 9
- Declare immutable fields
- Work with setters and getters
- Understand access modifiers in Java 9
- Combine setters, getters, and a related field
- Transform values with setters and getters
- Use static fields and static methods to create values shared by all the instances of a class