Java Array :
An array is a group of variable of similar data type that shares a common name, and store in continuous memory location.
The size of the array refer how many element an arra can hold.
We can identify an array element by using array name and its index number.
One of the primary goals of Java is safety, so many of the problems that plague programmers in C and C++ are not repeated in Java. A Java array is guaranteed to be initialized and cannot be accessed outside of its range. The range checking comes at the price of having a small amount of memory overhead on each array as well as verifying the index at run time.
The first element index number is 0, and last element index is less then one of the size of the array.
In Simple words, We can say that an array is used to store multiple values under single name.
Basically, array are of two types:
An array that has one subscript is known as a one-dimensional array.They store data in the form of vector, or list.
A one-dimensional-array can be any type like - int, char, float, long, double, etc
Syntax To Declare one-Dimensional-Array -
DataType ArrayNmae  = new DataType[size];
DataType  ArrayNmae = new DataType[size];
int  a = new int;
Valid and invalid array creations-
1) int a = new int;// CORRECT
2) int a = new int; // WRONG
3) int a;
Return length of an array
How to Traverse an Array -
There is another way of traversing array in java as we have seen earlier in loops using for-each-loop.
This will produce the same output as previous
An array takes memory at runtime.
An array is a static data structure its size can not grow and shrink.
Example - Sum of array elements
Example - write a program that reads two array and prrint the sum of corrosponding elements.
Sum of two array
An array that has two subscripts is known as 2-D array.
They store data in the form of matrix, or table where first subscript represents a column.
You can easily create multidimensional arrays. For a multidimensional array of primitives, you delimit each vector in the array by using curly braces:
Valid / Invalid 2D array declarations -
In Java, each row can have an equal number of column or an unequal number of columns.
int twod   = new int;/*This is how We can have unequal number of column.*/
Example - Write a program that read element in r*c matrix, and display them.
Sum of two array