Java Tutorial with Java Code Examples

Java Basics | String | Date | Collection | Java Map | Java Util | File I/O | XML | Threading | Network | i18n | Misc
Java Swing | JDBC | Servlet | JSP | JSTL | JMS | EJB | JPA | JSF | Struts | Spring | Hibernate
Web Services | Java PDF | JUnit | Ant | HTML | JavaScript | Apache | Tomcat | SQL | T-SQL | PL/SQL | MySQL

Java Basics

Introduction

Data Types and Arrays

Get User Input

Data Type Conversions

Control Flow

Handling Exception

 

  Java Basics » Control Flow » continue Statement

  Java Code Example:  ContinueStatementExample.java  Download Sample Source Code

/*
 * Copyright © 2008 - 2009 it.ibluespace.com. All rights reserved.
 */
public class ContinueStatementExample { public static void main(String args[]) { int[] integerArray = {13, 28, 56, 321, 258, 556, 12, 49}; int evenNumberCount = 0; //To print the the even numbers count in the array. for (int i = 0; i < integerArray.length; i++) { if ( integerArray[i] % 2 != 0) { continue; } //To process evenNumberCount++; } System.out.println ("There are " + evenNumberCount + " even numbers in the array."); } }
 Download Source Code: ContinueStatementExample.java

The command executed and output produced:


E:\JavaEECoding\>java ContinueStatementExample
There are 5 even numbers in the array.

Search for Java code examples on this site

 
 

Resources

Java Tutorial

Java World

Java SE 6 API Doc


Terms of Use  |  License  Copyright 2008-2009 it.ibluespace.com. All rights reserved.  | 
All other trademarks are the property of their respective owners.