Debugging Java code line by line

前端 未结 4 1974
南笙
南笙 2020-12-31 16:56

Is it possible to debug code line by line in Eclipse showing which line is executing so that I understand the logic of the code? I\'m new to programming, please give me suit

4条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2020-12-31 17:43

    Sure. You can set a breakpoint, at then step line-by-line in the debugger.

    This works by running your program in debug mode (the easiest way is to launch it with the Debug button as opposed to the Run button).

    In the Java source code view, you can click in the line number gutter to enable breakpoints.

    When execution hits that line, the Debug perspective will open, where you can inspect (and change!) all variables, and continue execution step by step.

提交回复
热议问题