java3

- Improved the java3 exercise to quit once Q is entered