Welcome -
Guest!
Login
/
Register Now
|
Search:
Home
Articles
Forum
Interview FAQ
Activities
News
Videos
Poll
Links
People
Groups
Java Articles
Submit Article
Home
»
Articles
»
Java
»
Fundamental
RSS Feeds
Continue Statement
Posted By:
Dorothy Taylor
Category:
Java
Views:
1994
This article explains about continue statement in java with examples.
Continue statement forces the iteration of the loop to take place, skipping any code in between itself and the test condition of the loop.
In
while
and
do-while
loops
, a
continue
statement will cause control to go directly to the test condition and then continue the looping process.
In
for loop
, the increment part of the loop is performed, the conditional test is executed and the loop
continue
s.
Syntax of Continue Statement
continue;
Example of Continue Statement
Example 1 : Program to print even numbers
class EvenNumberLoop
{
public static void main(String args[])
{
for(int i = 1; i <= 10; i++)
{
System.out.println("Even Numbers : ");
if(i%2 > 0)
{
continue;
}
System.out.println(i + ", ");
}
}
}
Output
Even Numbers : 2, 4, 6, 8, 10
Share:
Previous Post:
Break Statement
Next Post:
Switch Statement
Didn't find what you were looking for? Find more on
Continue Statement
Or get
search suggestion and latest updates
.
Dorothy Taylor
author of Continue Statement is from Baltimore,
United States
.
View All Articles
Related Articles and Code:
Program to illustrate the use of the continue statement
Program to show the use of the Continue Statement
Program to show the use of Labeled Continue Statement
Use of continue statement
Decision Making and Branching using if statement , switch statement , conditional operator and goto
Decision Making and Looping using while statement , do while loop , for statement
Create an SQL statement that will generate a series of GRANT statements to five new users
Program to show the use of Switch Statement for the same statement for several different case labels
Program to print some text on the same line using multiple print statements
Program using cout statement to display in single line
Switch Statement
Program to Create result statement for a given semester
Program to compare number is greater than 100 or not using if statement
Program to find greatest number from two numbers using if statement
Program to find smaller or greater numbers using if statement
Program that illustrates use of printf statement
Example of illustrating block of statement
Example - 2 of illustrating block of statement
Illustration of if else statement
Use of the goto statement
Other Interesting Articles in Java:
An applet program to display moving banner
Program of reading and writing primitive data
Method Overriding
Corba program of Count Client Applet, IDL,Server, Client
Relational Operators
An applet program to perform merge sort
Corba program of reverse string
Private Method
RMI application for counting factorial of a given number.
File handling program to copy characters from one file to another
Class modifiers in java
Program to check the start and end of a String
Program of creating a file using text fields in windows
Servlet which takes input from an HTML client page and calculates and outputs the premium amount
An applet program of linear sort
Develop a game application in CORBA for which the player will guess a number between 1 to 100, which will be compared to the random number generated b
File handling program to count number of characters in a file
Program to Concat Strings
An applet program to display barchart of given data
Program to search an element in an array using Linear Search
Please enter your Comment
*
*
Comment should be atleast 30 Characters.
Please put code inside [Code] your code [/Code].
Please login to post comment
Ajeet Kumar
from
India
Comment on:
Sep 21
Thanks for all the dailyfreecode groups.This is very beneficial site for us. Every student can access any program so, thanks alot..
View All Comments
Java
View All
Applet programs
Arrays
Comparison Operator
Corba
Data file structure
File Handling
Fundamental
Homework Help
Interview FAQ
Networking Technology
Operators
Remote Method Invocati...
Socket Programming
Assembly Language
Artificial Intelligence
C Programming
C++ Programming
Visual C++
OOAD
Cobol
SQL Server
Asp.net MVC
Rest and WCF Services
Entity Framework
Knockout.Js
Unix / Linux / Ubuntu
Networking
OOPs Concept
HTML
Dos
SQL
System Analysis & Design
Gadgets
Internet
CSS
Javascript
.Net Framework
Asp.net
C#
VB.Net
Python
Perl
Oracle
Software Engineering
RDBMS Terms
AJAX Framework
Design Pattern
UML
WPF
WCF
SEO
PowerShell
Visual Studio
WWF
BizTalk Server
Azure
General
Testing
Online Certifications
PHP
My SQL
LinQ
Project Management
Silverlight
XML
MS Office
Windows OS
DHTML
Sharepoint