Thursday, September 21, 2017

Java API ArrayList Example

Java API ArrayList Overview

In this tutorial, We'll learn about Java Collection API ArrayList.
ArrayList is a class which is widely used in real time applications. It is in package java.util and public class. This is added in java 1.2 version.

Java API ArrayList Example


Class Name: ArrayList
First Version: 1.2
Super Class: AbstractList
Implemented interfaces: List, RandomAccess, Cloneable, Serializable
Pacakge: java.util.

Saturday, September 9, 2017

Java Enhanced For loop, Examples

Enhanced for loop in java, Java enhanced for loop, Java for-each loop, Enhanced for loop example, Advantageous of for-each loop. Iterating through basic for loop. Iterating through Arrays, Iterating through Collection

Enhanced for loop to overcome the drawbacks of basic for loop and this best suitable for iterating Arrays and Collections.

Syntax:


for ( varaible_declaration : Array or Collection)
{
    //
}

Java Enhanced For loop, Examples

Java Continue Statement, Label loop

Java Continue Statement, Continue Statement in Java, Continue Examples in java, Java continue in inner loop, inner loop continue example, Continue Statement Examples.

Continue statement is used to skip the current loop iteration when a condition is satisfied.
Mainly used in while or for loop.

Syntax:

continue;

Example Flow chart:

Java Continue Statement, Label loop

Tuesday, September 5, 2017

Java Break Statement With Examples


Java break statement is used in a loop or switch case. If it encounters inside a loop then it terminates the loop and continues execution after the loop.

While loops in Java

It can be used to terminate a case in the switch statement.

Switch statement in java

Syntax:

break;

Flow Chart:

Java Break statement