problem id 2, java completed