Stepping Through Your Program

Once execution of your program is halted, you can move through your lines of code using the Step commands on the Debug menu. You can set options for stepping into a method, such as the action to perform when the source code is not available.

The Step commands include the following:

  • Step Into (F7). Executes one source line. If the source line is a method call, stops just before executing the first statement of the method. You can also start a debugging session with the Step Into (F7) command. Program execution stops on the first line after the main method before any changes have been made to the state of the program.
  • Step Over (F8). Executes one source line. If the source line is a method call, executes the entire method without stepping through the individual method instructions.
  • Step Out (Ctrl-F7). Executes one source line. If the source line is part of a method, executes the remaining lines of the method and returns control to the caller of the method.
  • To set options for stepping into a method:

    1. In the Options window, expand the Debugging and Executing node. Then expand the Debugger Settings node.
    2. Select the Java node.
    3. On the property sheet, modify the following properties to your preferred settings.
    See also
    Running to the Cursor Location
    Continuing a Program in the Debugger

    Legal Notices