Member 9410081570 wrote:
…when the inside for loop gets executed the outer for do not get executed…
Please forgive me this expression, but this is called
gibberish:
http://en.wikipedia.org/wiki/Gibberish[
^]. I'll explain…
I hope you just messed up your wording, because the logic is way too simple. If inner loop is executing, how its outer loop could probably no executed?
If it was the case, the execution would not even reach the inner loop. Your observations are simply incorrect: it's absolutely clear that your outer loop would execute 10 times, but only if there is no exception thrown in an inner loop. If exception is thrown, it will still execute once.
Now, about the exception: it's very strange that your loop starts from 1, not 0. All indexing of all collections is always zero-based. And you also increment the expression for
id
by 1 and 2. Are you sure that your IDs are numbered starting from 2? Perhaps you need to renumber your IDs in a regular zero-based manner, to avoid mess-up.
After all, you need to run your code under the debugger, to see what's really going on.
—SA