does anyone know how to terminate a java program when the user input the wrong answer after x amount of tries

2 answers

exit()
You can return an exit code to indicate failure.

google can provide you with code snippets for almost whatever you want to do. You can be sure that someone has done it, and posted it. Also, the java documentation is excellent.
ok thank you oobleck