but i m not getting any output
What shows on the console when you try to execute this program?
There must be an error message.
NormR1
Posting Sage
7,742 posts since Jun 2010
Reputation Points: 1,158
Solved Threads: 793
Skill Endorsements: 16
Ezzaral
null
16,109 posts since May 2007
Reputation Points: 3,292
Solved Threads: 873
Skill Endorsements: 27
Check your logic to see if where it goes that there is nothing printed when it goes there. If there is a path it can take without anything printing, check to see why.
Add some println statements to show the values of variables as they are changed and to show the execution flow. Then you will get something printed out.
NormR1
Posting Sage
7,742 posts since Jun 2010
Reputation Points: 1,158
Solved Threads: 793
Skill Endorsements: 16
If he puts some printlns in the infinite loop he will see that.
Then hopefully he'll wonder why the loop is forever and look at the code to see why.
By printing out the variables used in the loop he could get a clue.
Otherwise, we'll have to suggest where and what for him to look at.
NormR1
Posting Sage
7,742 posts since Jun 2010
Reputation Points: 1,158
Solved Threads: 793
Skill Endorsements: 16
If you are printing out more than one variable, put an id label on the print out so you know what value it is that was printed:
System.out.println("variable_to_be_tracked=" + variable_to_be_tracked);
NormR1
Posting Sage
7,742 posts since Jun 2010
Reputation Points: 1,158
Solved Threads: 793
Skill Endorsements: 16