Do While loop in Java

Do – While loop is same as While loop except in this case loop is confirmed to execute once(Means in any case statements in Do-While block will execute atleast once).

Syntax of Do-While Loop


As you can see in this loop expression is evaluated in the end. So for the first time block will executed irrespective of the value of expression.

Sample code


Output of the above program would be

3 Comments Do While loop in Java

  1. rewati

    why is this page not mentioned under the list of core java topics? May i have the whole list at one place please. thankyou

    1. admin

      Hi Rewati,

      Thanks for your comment. Not all articles are listed under Core Java Section(My Mistake). Some might be missing.

      Soon i will update site to have next and previous button for better navigation. And also add missing topic in Core Java Section. If you are looking for some topic please search it.

      If you are searching for a particular article which is not present in site do let me know so that i can add the same.


  2. orkun


    Thanks for putting so much effor in this site. It is very useful.

    But could you please, as rewati mentioned, provide a complete site map? It is hard to follow through when some articles are missing, or the order isn’t clear.

    The previous and back buttons you have placed seem to be directing us to the wrong page, not really related to the current topic.


Leave A Comment

Your email address will not be published. Required fields are marked *