problem 3 files

add java files for problem 3