0 оценок0% нашли этот документ полезным (0 голосов)
14 просмотров6 страниц
The document discusses a Person class with attributes of first name, middle initial, and last name. It includes constructors, getters/setters, and a toString method to print a Person's name with or without a middle initial. A PersonDriver class is used to test creating Person objects, printing them, comparing them for equality, copying them by reference, and passing a Person object to a method to change its properties. The code shows how primitive types and object references are treated differently when passed to methods.
The document discusses a Person class with attributes of first name, middle initial, and last name. It includes constructors, getters/setters, and a toString method to print a Person's name with or without a middle initial. A PersonDriver class is used to test creating Person objects, printing them, comparing them for equality, copying them by reference, and passing a Person object to a method to change its properties. The code shows how primitive types and object references are treated differently when passed to methods.
The document discusses a Person class with attributes of first name, middle initial, and last name. It includes constructors, getters/setters, and a toString method to print a Person's name with or without a middle initial. A PersonDriver class is used to test creating Person objects, printing them, comparing them for equality, copying them by reference, and passing a Person object to a method to change its properties. The code shows how primitive types and object references are treated differently when passed to methods.