Midterm2 part 2 java