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:
2116
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 to declare, initialize and print a 2D array of integers
An applet program showing Clicked Event on canvas
Program to calculate the frequency for different values of C starting from 0.01 to 0.1 in steps of 0.01
Develop a RMI based application for addition of two complex numbers
Type conversion in expression
An applet program of showing new document using showDocument(URL) method
Program which calls the method sort(int []a) which throws the Exception ArithmeticException, NullPointerException, ArrayIndexOutOfBoundsException
Static methods and variables
Transient Variable
Program to print a string on Standard Output Device
Program to show an example of getting at characters in a String
An applet program that concatenates two string entered in TextField
An applet program to perform merge sort
Control Statements
Develop a CORBA application that takes a string from client and returns whether it is palindrome
File handling program to copy characters from one file to another
Program to display text
An applet program to display alternate filled and empty circle that to in row and column format
Program sets up a String variable containing a paragraph of text of your choice. Extract the words from the text and sort them into alphabetical order
corba program of client and a DNS server where given a URL the server sends back an IP address
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