Code written while learning Java