New Watch Dialog Box

The New Watch dialog box enables you to specify variables or expressions to watch continuously when debugging your program. You open this dialog box by choosing Debug and choose New Watch or by using the contextual menu in the Source Editor. When you open the dialog box from the Source Editor, the Watch Expression field contains the name of the variable that the insertion point is on.

When you specify an expression to watch, follow the syntax rules of the debugger that you are using.

When you create a watch, the value of the variable or expression is immediately evaluated and displayed in the Watches window. The value is based on the current context. When you change the current context, the Watches window is updated to show the value of the watch for that context.

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

See Also
Current Context in the Debugger
Variables and Expressions in the IDE

Legal Notices