Thats what your if-else is for: anything that you write in the else-branch won't be executed (instructions after the else-branch still will be done).
If you really want to end your program, you can use System.exit(). This will cause the
java virtual machine to stop executing, so make sure you really do this as the last instruction (for example, after your block() method).