java assignment ex2