Link to home
Start Free TrialLog in
Avatar of Kevin_Coors
Kevin_Coors

asked on

Nested For Loops in Java

Hello

I am taking a shot in the dark here.

Could anyone explain in simple terms how a nested for Loop works please?

I have just got used to working with single looping structures and I have been introduced to nested loops and I just cannot seem to get my head around them.

Thanks
Avatar of krakatoa
krakatoa
Flag of United Kingdom of Great Britain and Northern Ireland image

Kevin - we've covered this one before I am pretty sure. What difficulties have you run into now?
In 'short' - a loop completes whatever task you set it, up to its iteration limit. If it is enclosed by another loop, - (nesting) - that outer loop takes another iteration, and the inner loop is repeated.
Avatar of Kevin_Coors
Kevin_Coors

ASKER

Hi Krakatoa

We covered nested if statements the last time

Thanks
ASKER CERTIFIED SOLUTION
Avatar of krakatoa
krakatoa
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
We covered nested if statements the last time

*Did* you mean nested, then? If so, there's a short and v simple one above. Let us know if this is not what you had in mind. There is plenty of help here if it isn't.
And you didn't knock a single point off because I names the outer loop 'out' instead of 'outer' ! ;)
Thanks again :)