Q.4. Controlling Execution Using the step, step up and next Commands

Sometimes you will need to execute an application line by line to find and fix errors. Walking through a portion of your application this way can help you verify that a method’s code executes correctly. In this section, you will learn how to use the debugger for this task. The commands you learn in this section allow you to execute a method line by line, execute all the statements of a method at onceor execute only the remaining statements of a method (if you have already executed some statements within the method).

Once again, we assume you are working in the directory containing this appendix’s examples and have compiled for debugging with the -g compiler option.

Starting ...

Get Java™ How to Program, Seventh Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.