Q.3. The print and set Commands

In the preceding section, you learned how to use the debugger’s print command to examine the value of a variable during program execution. In this section, you will learn how to use the print command to examine the value of more complex expressions. You will also learn the set command, which allows the programmer to assign new values to variables.

For this section, we assume that you have followed Step 1 and Step 2 in Section Q.2 to open the Command Prompt window, change to the directory containing this appendix’s examples (e.g.,C:\examples\debugger) and compile the AccountTest application (and class Account)for debugging.

1.
Starting debugging. In the Command Prompt, type jdb to start the Java debugger.
2. ...

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

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.