Friday, 19 October 2018

Array ( Part 2 )




Hey, guys


# There are two types of array.

  1.  Single Dimensional Array 
  2.  Multidimensional Array


# Single Dimensional Array


whatever we learn in the previous post is all about basics of an array and all pics are belongs to "Single Dimensional Array".

Now, We are going to discuss on syntax and program on it.



It is a two-step Process...

Step 1 )
These are three (3) ways to Declare An Array...




Step 2 )
Way to instantiation/initialization of an array....





This step is a combination of Step 1 and Step 2




This is a basic program to declare, initialize and display character array.






# Multi-Dimensional Array


Multi-Dimensional Array is a " MATRIX ". It has a ROW and  COLUMN .
But  In java , we have somthing called "JAGGED ARRAY".



A jagged array in Java is a multi-dimensional array comprising arrays of varying sizes as its elements. It’s also referred to as “an array of arrays” or “jagged array”.



But you don't need to bother about terms because it works same as 2D Array (Multi-Dimensional Array) but internally it different with 2D Array.








If you want to understand it in more deep and better ways --- go to this site -- "  www.baeldung.com " Detailed Description.






No comments:

Post a Comment