Sogang university java language HW 3