Break Statement in Java

Published on July 17, 2015 by abundantcode

Filed under Java

Last modified July 17, 2015

Print this page

rate 1 star rate 2 star rate 3 star rate 4 star rate 5 star
Your rating: none, Average: 0 (0 votes)

This article have been viewed 1935 times

Java provides the break keyword that is used by the developers to exit out of the loop before the actual completion of the loop. Additionally , the break keyword can also be used to jump out of a single case in switch statement.

Break Statement in Java

Below is a sample code snippet demonstrating the usage of the break statement in java.

package com.abundantcode;

import java.util.ArrayList;
import java.util.List;
public class Main {

    public static void main(String[] args)
        List<String> input = new ArrayList<String>();
        input.add("Programming Website");
        input.add("Java Tutorials");
        for(String item:input)



If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.

Leave a Comment


You might be Interested in these Posts

How to use array Rank in C# ?

In C# , the Rank property of the array is is used to get the rank of the array. In simple terms , ra...

How to hide virtual keyboard in android using Java?

There are times when you want to hide the virtual keyboard in android. You can easily do that using ...

Json.NET & VB.NET - How to Deserialize an Object ?

One of the ways to Deserialize an object to JSON string in VB.NET in the Json.NET is using the DeSer...