Summary

Section 8.2 Time Class Case Study

  • Every class you declare represents a new type in Java.

  • The public methods of a class are also known as the class’s public services or public interface. The primary purpose of public methods is to present to the class’s clients a view of the services the class provides. Clients of the class need not be concerned with how the class accomplishes its tasks. For this reason, private class members are not directly accessible to the class’s clients.

  • An object that contains consistent data has data values that are always kept in range.

  • A value passed to a method to modify an instance variable is a correct value if that value is in the instance variable’s allowed range. A correct value is always a consistent value, ...

Get Java™ How to Program, Seventh Edition 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.