What exactly does "initialization of arrays" mean? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What exactly does "initialization of arrays" mean?

17th Oct 2020, 4:29 AM
Bharadwaaja Kanakadandi
Bharadwaaja Kanakadandi - avatar
5 Answers
+ 6
int[] someArray = new int[4]; int[] someArray = new int[4] {1,2,3,4}; int[] someArray = new int[] {1,2,3,4}; int[] someArray = {1,2,3,4};
17th Oct 2020, 4:44 AM
Orchiiik
Orchiiik - avatar
+ 4
The process of assigning values to the array elements is called array initialization. 
17th Oct 2020, 5:51 AM
Sanidhya Varshney
+ 3
If you have an int array, the initialization of it is: int arr[] = {1, 3, 2, 29};
17th Oct 2020, 4:32 AM
你知道規則,我也是
你知道規則,我也是 - avatar
+ 1
Martin Taylor I don't know he use c++ I only tells that the declaration done by Amanbek Orynbay is correct
17th Oct 2020, 10:27 AM
Sanidhya Varshney
0
Answer by Amanbek Orynbay is correct because we use this type of declaration in Java
17th Oct 2020, 5:52 AM
Sanidhya Varshney