Looping Control Structures.

In this article,Looping Control Structures are explained in detail with examples.
These control structures are used to execute a block of statements continuously/iteratively based on a condition.
1.While loop
It is also known as pre-test loop i.e. first, we check the condition and if it is true, then it executes
the body. 
Syntax
initialization;
while(condition)
{
-----
body;
----
increment/decrement;
}

Nested Loop and Labeled break and Labeled continue.

In this article,Nested Loop and Labeled break and Labeled continue is explained in detail with examples.Using a particular looping structure inside an another looping structure is known as nested loop.
Syntax
outer-loop:(no of rows)
{
Inner-loop:(no of columns)
{
----
----
}
}

Getting input from Keyboard.

In this article,Getting input from Keyboard is explained in detail with examples.
"Scanner" is a class, using which, we can accept input from standard input device i.e.Keyboard.
This class is available in java.util package.Such package need to be imported in a java program.
Ex 
import java.util.*; or
import java.util.Scanner;
To use this class,we create object of this class.
Ex
Scanner sc=new Scanner(System.in); //System.in defines standard input device i.e. Keyboard.
for getting the input from keyboard the statement should be in the format shown below
String ss=sc.next(); 
String ss=sc.nextline();     (From topic Getting input from Keyboard)

Arrays in Java.

In this article,Arrays in Java is explained in detail with examples. you will come to know about what are Arrays in Java, how they are defined and how they are initialized in the Java program.
An Array is a collection of elements of same data type.
Syntax
(datatype) array name[]; //array declaration
Ex
int a[]; //no size of array should be given.
In java,while declaring an array, we don't give the size. After declaration, size is allocated to the new operator. (From topic Arrays in Java)
Syntax
arrayname=new (datatype)[size];
Ex
a=new int[5];

Examples on Arrays and ForEach Loop.

In this article,Examples on Arrays and ForEach Loop are explained in detail with examples. we will solve some examples related to the arrays and learn about Foreach Loop.
Ex
//programs related to Examples on Arrays and ForEach Loop--the sum of elements in an array.
class ArraySum
{
public static void main(String args[])
{
int a[]={11,22,33,44,55};
int i,sum=0;
for(i=0;i<5;i++)
sum=sum+a[i];

Connect with Us by Subscribing here for more Updates..!

* indicates required