Code written to learn Java