Java Programming Tutorial - 31 - Enhanced for Loop
Top Comments
All Comments (173)
-
I'm confused.
I can see the for loop is assigning bucky's values to x, plus the total is adding x to itself each loop. But what is controlling which of bucky's values are being added to x?
The way I'd usually go about this would be to have a counter increasing each loop until a desired figure is reached, with bucky[counter] identifying which of bucky's values I want to access. Counter 0 accessing bucky 0 and then 1, 2, 3 etc.
I don't see what is controlling this in this videos code.
-
@sublimeftw2 Ubuntu, a linux distribution, also has it. :)
-
Interesting fact: With the "enhanced for loop" you can not change the integer stored in the array.You can only read-access them. I tried, it wouldn't work, I looked it up. So you still have to use the (int x=0;x<100;x++) to change the information stored within the array.
-
@lyrrad999 Initializing is setting a first value for a variable. It's kinda inactive or something before then (Correct me if I'm wrong)
-
@lyrrad999 instead of writing int bucky[5] and then writing out all the values like this:
bucky[0] = 3
bucky[1] = 4
etc...
You write int bucky[]={3,4,5,6,7};
the [] after the int (integer) and variable title indicates it's a array. Also, the items in the curly brackets {} are the "bucky[0] = 3"s. If someone can better explain this that'd be great. If you are still confused, watch episode 27 of this series.
-
i know basic array but what is array initiliazer??
-
can someone explain me what int bucky[]={3,4,5,6,7}; ???
-
This doesn't work anymore, could you please make a tutorial on how to do it in JRE 6.0?
windows 7 snap feature makes this sooooo much easier to follow
sublimeftw2 5 months ago 4
Does anyone know of any tools that I could use to review/brush up on the information from these tutorials.
The tutorials are great but after a day I tend to forget stuff. Anything like worksheets, quizzes, games, questionnaires, exercises or challenges would be perfect and would help a long way.
TheSamLegacy 2 weeks ago in playlist Java (Beginner) Programming Tutorials 2