Variables and Expressions in the IDE

See Also

All the local variables that are within the current call are listed in the Local Variables window. The information given for each variable includes the variable name, type, and value. You can change the value directly in the Local Variables window and then continue running your program with the new value in place.

You can see values of local variables only if the class is compiled with the -g option. If you compile your program using the IDE's external compiler, this option is on by default. You can verify this setting by opening the Options window, expanding Building and expanding Compiler Types and selecting External Compilation. If the checkbox for the Debug property is selected, the -g option is on.

In some cases, the Java 2 debugger assigns a pound sign (#) and a number as the variable's value. This number is an unique identifier of the given instance. You can use this identifier to determine if a variable points to the same instance or to a different instance. You cannot edit this value.

You can also evaluate a variable directly in the Source Editor by moving the pointer over the variable. If the variable is active in the current context, the value of the variable is displayed in a tool tip. In cases where a program includes different variables with the same name, the Source Editor displays the value based on the current context, and not on the instance of the variable in the source code.

You can track the changes in the value of a variable during program execution by setting a watch on the variable. When you create a watch, the value of the variable is immediately evaluated and displayed in the Watches window.

See Also
Modifying the Value of a Variable
Creating a Watch
Creating a Fixed Watch
Deleting a Watch
Current Context in the Debugger

Legal Notices