Java code used to teach Java and OOP