Kotlinlearncs.online LogoJava
Return to List

Solve: University Class Create

Created By: Ellen Spertus
/ Version: 2024.1.0

Create a class University with final private instance variables for the name (String) and founding year (int). Create public getters getName() and getFoundingYear() and override the equals() and toString() methods.

Two instances of University should be equal only if they have the same name and founding year.

The printed representation of a university should be "Northeastern University (est. 1898)" if its name is "Northeastern University" and its founding year is 1898.

This shows how the class might be used:

Related Lessons

Stuck? You may find these lessons helpful:

Report a Problem

Attribution must link to this page: https://www.learncs.online/solve/java/university-class-create/[email protected]