Solve problems 64-65 using Java.