1

anyone know how to set a String variable to null into netbeans debugger? If I use the variable panel and write null as the variable value it understand the string "null". I tried to completely delete the variable value by pressing canc but it understand the empty string "". How can I set it to null ?

user2572526
  • 1,219
  • 2
  • 17
  • 35

1 Answers1

3

As described at How can I change the value of a variable while debugging Java code in NetBeans 7.1?, you can use "Evaluate Expression..." under menu Debug option (Ctrl+F9) and execute code snippets in the window while paused at a breakpoint. For example, type

myStringVariable = null;

then press Ctrl+Enter or click on the green button in the lower right corner of the window to execute that code.

Community
  • 1
  • 1
David
  • 251
  • 2
  • 11