June 2017
Beginner
1296 pages
69h 23m
English
In this chapter, we presented additional class concepts. The Time class case study showed a complete class declaration consisting of private data, overloaded public constructors for initialization flexibility, set and get methods for manipulating the class’s data, and methods that returned String representations of a Time object in two different formats. You also learned that every class can declare a toString method that returns a String representation of an object of the class and that method toString can be called implicitly whenever an object of a class appears in the code where a String is expected. We showed how to throw an exception to indicate that a problem has occurred.
You learned that the this reference is used implicitly ...