F. Classes and Objects: A Deeper Look

Objectives

In this appendix you’ll learn:

• Encapsulation and data hiding.

• To use keyword this.

• To use static variables and methods.

• To import static members of a class.

• To use the enum type to create sets of constants with unique identifiers.

• To declare enum constants with parameters.

• To organize classes in packages to promote reuse.

Outline

F.1 Introduction

F.2 Time Class Case Study

F.3 Controlling Access to Members

F.4 Referring to the Current Object’s Members with the this Reference

F.5 Time Class Case Study: Overloaded Constructors

F.6 Default and No-Argument Constructors

F.7 Composition

F.8 Enumerations

F.9 Garbage Collection

F.10 static Class Members

F.11 final Instance Variables

F.12

Get Android How to Program 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.