This is possible when in the debugger. The following is from NB's Help - See "Fixing and Continuing" topic.
If you find a problem while debugging, you can use the Apply Code Changes command to fix your source and then continue debugging with the changed code without restarting your program.
It is not possible to use the Apply Code Changes command to do the following:
- Change a modifier of a field, a method, or a class
- Add or remove methods or fields
- Change the hierarchy of classes
- Change classes that have not been loaded into the virtual machine