Understanding Break and Continue Statement in Java using Eclipse IDE

in #utopian-io8 years ago (edited)

In this tutorial, you will learn the following:

  • Break Statement: The Break statement is used when you want code execution to move out of a code block and unto the next line, this is mostly used to exit loops,if statements when a certain condition is met.
  • Continue Statement: On the other hand, the continue statement is used to skip a particular condition, it tells code execution to ignore the rest of the codes in the code block and start all over again.

You would need the following inorder to following this tutorial:

  • An Integrated Development Environment(IDE) installed that can run Java (e.g Netbeans, Eclipse)
  • JDK 1.X installed on your Pc
  • Of course willingness to learn

Difficulty

  • Intermediate

Description

In this tutorial, the break and continue statement is used in a for loop to print numbers ranging from 1 - 10. The break statment is used to exit the loop when the number 9 is reach and then the number 5 is ignored using the continue statement.

Video Tutorial Link:

Curriculum

Below are a list of related videos that will make you understand this better!

Tutorial Logo

NB: This video has only being shared on my Youtube Channel

Tutorial codes can be gotten from this github repository: https://github.com/generalkolo/Javacodes



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Thank you for the contribution. It has been approved.

You can contact us on Discord.
[utopian-moderator]

Hey @edetebenezer I am @utopian-io. I have just upvoted you!

Achievements

  • You have less than 500 followers. Just gave you a gift to help you succeed!
  • Seems like you contribute quite often. AMAZING!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

Coin Marketplace

STEEM 0.04
TRX 0.32
JST 0.088
BTC 61515.09
ETH 1702.35
USDT 1.00
SBD 0.38