BeignTech - Tech That Matters Array: Array Contruction

Array: Array Contruction

 Every array in java is an object, here we can create by using new operators

                int [] a = new int[3];

for every array type corresponding classes are available,but these classes are not applicable for prograrmmer level.


Array Type Correspomding Classname
int [] [I@___ _ _
int [] [] [[I@....
double[] [D@....

At the time of construction complusury we should specify szie otherwise we will get C.E.


It is legal to have an array with size O in java
        int [] a = new int [0];    

if we are specifying array size as -ve int value, we will get runtime exception saying NegetiveArraysizeExeption. To specify array size the allowed datatypes are byte,short,int,char, if we using any other types we will get c.e.


  • The max allowed array size in java is 2147483647


  • Array declaration 
  • Array creation
  • Array initialization
  • declaration creation, Initialization in a signle line
  • lenght vs Lenght()
  • Annonymous Array
  • Array element assignments
  • Array variable assignment 

  • Post a Comment

    Previous Post Next Post