kavi lathigra wrote:
first of all
in the loop
while(++i<=10) // the i value is already 11, so condition fails..
so !
To understand what is happening in something like this I usually put a System.out.println() in the loop. Or two, one at the top of the loop and one at the bottom. There could be one before the i++; and one after to show what is happening and how many iterations it is doing.