Java assignment 1