how is an array creation in java a two way process...?? plz explain briefly...
Answers
Answered by
2
You can create an array in java in 2 ways:
(I am creating an integer array)
1. int[ ] arr=new int[5] // here, I created an array named arr of length 5. you can use this method of creation of array for accepting the values form the user.
2. int[ ] arr= {0,1,2,3,4} // here, an array arr is created and initialized before run time.
(I am creating an integer array)
1. int[ ] arr=new int[5] // here, I created an array named arr of length 5. you can use this method of creation of array for accepting the values form the user.
2. int[ ] arr= {0,1,2,3,4} // here, an array arr is created and initialized before run time.
Vintage:
is this the reason why array creation is a teo way process
Similar questions