PPT Slide
Thus, to create what is logically a record, define a class (ala a type), specifying both:
the data fields of the record
all the methods that can act upon those data.
Because we can use a class to encapsulate
both the data and the methods associated
with the what would be a record, there is no
need for a record construct.
Java doesn’t need a record construct
Java doesn’t have a record construct.
Instead, one implements records
(with methods) as a class.
In Java, any data structure that is not a primitive must be an object of some class.