Assigment_2 for java course