Welcome to the Java Programming Forums

The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: The defitition of nested loop

  1. #1
    Junior Member
    Join Date
    Oct 2010
    Thanked 0 Times in 0 Posts

    Default The defitition of nested loop

    All I wanna ask is : if i have 3 for loops.can I say that there are 2 nested loops or it must be 1 heavily nested loop ? It's just the way of thinking but I need to make sure about it as I and my friends are debatin'

    for {
        for  {
            for  {

  2. #2
    Member Darryl.Burke's Avatar
    Join Date
    Mar 2010
    Madgaon, Goa, India
    Thanked 48 Times in 46 Posts

    Default Re: The defitition of nested loop

    Short answer: it doesn't matter.

    Longer answer: keep debating until it comes to fisticuffs, and you'll find that the most brawny, least brainy, prevails.

    Honestly, find a better way to pass your time. For example, answering stupid questions on forums.


  3. #3
    Super Moderator helloworld922's Avatar
    Join Date
    Jun 2009
    Thanked 619 Times in 561 Posts
    Blog Entries

    Default Re: The defitition of nested loop

    ^^ lol.

    Anyways, I would probably say that you have a for loop nested inside a for loop nested inside a for loop. Saying you had 3 nested for loops kind of brings to mind having 3 sequential loops nested instead of what is really happening.

    More importantly, if your audience understands what you're talking about you could call it whatever you want (like super triple stack for loop).

  4. The Following User Says Thank You to helloworld922 For This Useful Post:

    silentbang (January 29th, 2011)

Similar Threads

  1. do while loop with nested while question
    By johneusmc in forum What's Wrong With My Code?
    Replies: 10
    Last Post: October 6th, 2010, 04:45 PM
  2. nested loop
    By b109 in forum Java Theory & Questions
    Replies: 1
    Last Post: May 30th, 2010, 10:05 AM
  3. Nested try blocks
    By Ahmed. in forum Member Introductions
    Replies: 2
    Last Post: April 30th, 2010, 08:12 AM
  4. Equilateral Triangle Using nested for loop
    By uchizenmaru in forum Loops & Control Statements
    Replies: 2
    Last Post: January 14th, 2010, 10:01 PM
  5. [SOLVED] Trouble with draw and fillRect in pyramid logic using nested loop
    By LiquidMetal in forum Loops & Control Statements
    Replies: 4
    Last Post: April 27th, 2009, 03:25 AM