Consider a java program with many variables and some of them are counters for loops I want to see the values of these variables as they change with time , WITHOUT putting print statements everywhere in my code.
Why ? I think it can help me to debug easily.
Example-
int a = 7;
for(i=0; i<3; i++)
{
a++;
}
As this program runs I want to get live reports like this:
t is 0, a is 7, i is 0
t is 3, a is 8, i is 1
t is 12, a is 9, i is 2
(t is time, time factor is NOT necessary though)
You should use a debugger and put a breakpoint where you want to see the values (in this case at the line with a++). The you can see the value at each iteration.
Most IDEs have debuggers (Intellij IDEA, Eclipse or NetBeans).