+ 4

I can't understand arrays in have

I can't understand arrays in java

6th Sep 2017, 9:22 AM
Ali Aish
Ali Aish - avatar
6 Answers
+ 7
answer is there @Ali
6th Sep 2017, 11:38 AM
Changed
Changed - avatar
+ 6
see this 👇👇👇 https://www.sololearn.com/Discuss/230542/?ref=app
6th Sep 2017, 10:45 AM
Changed
Changed - avatar
+ 2
hum let us say you can't understand arrays if so, an array holds data in slots int[] myArray ={1,5,6}; to get 5 you do myArray[1];
6th Sep 2017, 9:41 AM
Abdur-Rahmaan Janhangeer
Abdur-Rahmaan Janhangeer - avatar
+ 1
Thank. but I want to understand how it=42
6th Sep 2017, 11:34 AM
Ali Aish
Ali Aish - avatar
+ 1
I'm assuming you are referring to 6/13 in data types, arrays, and pointers where it says... int array [5] for (x=0; x < 5; x++) { array [x] = 42 } In the code above all elements in the array will equal 42 because by saying array [x] = 42 we made all indexes equal 42. Basically we said that if the index is less than 5 then the index equals x. Then we plugged x into the array so all indexes less than 5 equal 42.
18th Sep 2017, 2:47 PM
Dylan
0
I can't understand the steps. I am new here
6th Sep 2017, 11:39 AM
Ali Aish
Ali Aish - avatar