Section 8.2 Time Class Case Study
• The public
methods of a class are also known as the class’s public
services or public
interface (p. 316). They present to the class’s clients a view of the services the class provides.
• A class’s private
members are not accessible to its clients.
• String
class static
method format
(p. 318) is similar to method System.out.printf
except that format
returns a formatted String
rather than displaying it in a command window.
• All objects in Java have a toString
method that returns a String
representation of the object. Method toString
is called implicitly when an object appears in code where a String
is needed.
Get Java™ How To Program (Early Objects), Tenth 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.