Many IDEs use a tool called Printpoint to output the value of a variable to the console. It is the same as putting a print
statement in the code. Unfortunately, Eclipse does not support Printpoint as a separate breakpoint type, but we will use a conditional breakpoint, which will give us the same result.
Please unset Watchpoint and make sure that the debugger is terminated. We will also need to comment out line 113, otherwise we won't be able to see Printpoint. So your line 113 should look like the following:
System.out.println("-=Employee Andrew=-"+andrew.toString());
number = _number
), set a breakpoint, right-click on it, and go to Breakpoint Properties….System.out.println("employee number is "+number+ " but soon will be " + _number); return false;
In these two lines we are doing two things. We are printing the value of number
and _number
, and also asking the application to not stop on the breakpoint by returning false.
After running the debugger you should see the following output:
With Printpoints, you don't need to put your print statements in the code, which saves you time on looking for the print statements and removing them after you are done with debugging.
3.15.12.34