Problems with java loops

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ray2007colon
    New Member
    • Mar 2007
    • 5

    #1

    Problems with java loops

    Hi, I have a confusion with java loops, I’m a student and I don’t understand how after you are at the end of the program loop back to the middle, to do a step again. I don’t understand where to put the loop. I tried, while, do while and if else, but I’m very confuse. Please help.
  • sicarie
    Recognized Expert Specialist
    • Nov 2006
    • 4677

    #2
    Originally posted by ray2007colon
    Hi, I have a confusion with java loops, I’m a student and I don’t understand how after you are at the end of the program loop back to the middle, to do a step again. I don’t understand where to put the loop. I tried, while, do while and if else, but I’m very confuse. Please help.
    Check out this tutorial for Sun's tutorial of loops in Java.

    Comment

    • MMcCarthy
      Recognized Expert MVP
      • Aug 2006
      • 14387

      #3
      This questions is being moved to the Java forum.

      ADMIN

      Comment

      • hirak1984
        Contributor
        • Jan 2007
        • 316

        #4
        you can write some sample code,try to execute it.post the erros and sample code... then it will be easier to show you right way.
        Originally posted by ray2007colon
        Hi, I have a confusion with java loops, I’m a student and I don’t understand how after you are at the end of the program loop back to the middle, to do a step again. I don’t understand where to put the loop. I tried, while, do while and if else, but I’m very confuse. Please help.

        Comment

        • ashsa
          New Member
          • Feb 2007
          • 45

          #5
          Originally posted by hirak1984
          you can write some sample code,try to execute it.post the erros and sample code... then it will be easier to show you right way.
          if-else are just blocks and not loops.

          loops are those loop back till the given condition holds true.

          for,while and do-while each have their own conditions checked during the iterations. Go thru the references available online or a basic java book.

          Comment

          Working...