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:
2086
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:
Program in CORBA which takes a long sentence from the client (at least 7 words), passes to the server, server separates out each word
Program to make directory
An applet program to display Vertical Color Bar
An applet program to display sum of two number of textField
this keyword in java
Program to show an example of using a Static Nested Class outside the Top-Level Class
CORBA based application for addition of two mathematical expressions of the form (ax + by) and displaying the result on client side
Program to show an example of Calling a Base Class Method from a Derived Class
Program to show the use of Switch Statement for the same statement for several different case labels
Program of UDP news server
Comparison Operators
Given a list of marks ranging form 0 to 100, write a program to compute and print the number of students marks
Program to read bytes from a file
Program to show the use of For Loop
Program of storing and retrieving integers using data streams on a single file
Program using Switch case to compute the net amount to be paid by a customer
Corba program of UDP client server application which sends the news to the client. Server takes the news from the NewsDataFile located at the server
An applet program to draw Polygon Graph with given data
Switch Statement
Program to show an example of Copying i.e. Clonning Objects
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