Book 3
Object-Oriented Programming
Contents at a Glance
Chapter 1: Understanding Object-Oriented Programming
What Is Object-Oriented Programming?
Understanding Objects
Understanding the Life Cycle of an Object
Working with Related Classes
Designing a Program with Objects
Diagramming Classes with UML
Chapter 2: Making Your Own Classes
Declaring a Class
Working with Members
Using Getters and Setters
Overloading Methods
Creating Constructors
Finding More Uses for the this Keyword
Using Initializers
Using Records
Chapter 3: Working with Statics
Understanding Static Fields and Methods
Working with Static Fields
Using Static Methods
Counting Instances
Preventing Instances
Using Static Initializers
Chapter 4: Using Subclasses and Inheritance
Introducing Inheritance
Creating Subclasses
Overriding Methods
Protecting Your Members
Using this and super in Your Subclasses
Understanding Inheritance and Constructors
Using final
Casting Up and Down
Determining an Object’s Type
Poly What?
Creating Custom Exceptions
Chapter 5: Using Abstract Classes and Interfaces
Using Abstract Classes
Using Interfaces
More Things You Can Do with Interfaces
Using Additional Interface Method Types
Chapter 6: Using the Object and Class Classes
The Mother of All Classes: Object
The toString Method
The equals Method
The clone Method
The Class Class
Chapter 7: Using Inner Classes, Anonymous Classes, and Lambda Expressions
Declaring Inner Classes
Using Static Inner Classes
Using Anonymous Inner Classes
Using Lambda Expressions
Chapter 8: Working with Packages and the Java Module System
Working with Packages
Putting Your Classes in a JAR File
Using Javadoc to Document Your Classes
Using the Java Module System