Java codes for school