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];

Possible Array Declarations and 2-D Arrays.

In this article,Possible Array Declarations and 2-D Arrays are explained in detail with examples.
In java we can declare an one dimensional arrays in possible ways.
int a[];
int []a;
int...a; //used only as varargs in methods
          // as last parameter.
Command line arguments
The main method takes string arrays as the input parameter.Such parameters could be passed as arguments while executing the Java program.
Syntax

Matrix addition,subtraction and Wrapper Classes.

In this article,Matrix addition,subtraction and Wrapper Classes are explained in detail with examples.
To perform these operations, the necessary and sufficient condition are both the matrices should be of same order because the operation is performed on corresponding elements from both the matrices.
Ex
//program related to Matrix addition,subtraction and Wrapper Classes-add,subtraction of a matrix.
class MatrixAddSub
{
public static void main(String args[])
{
int a[][]=new int[2][2];
int b[][]=new int[2][2];

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

* indicates required