For those who're struggling! It's easy to look at this type of loops as at the shopping list example. Let's say you have an array named string shoppingList[] = {eggs, milk, bread, tuna}; Now when it comes to the loop, here's what you can do: for (string item: shoppingList) { System.out.println(item); } The output will be strings like this: eggs milk bread tuna Basically, it's an easy way to write a for loop but you don't have to specify the length of array and increment the counter because this loop takes this data from the array . And it's also a convenient way for naming an x in a descriptive way like "item" so you know what you're accessing.
Can you help with using enhanced for loops when nested, like for 2D arrays? The best method I came up with so far is: int[][] nums = {{0,1,2,3}, {4,5,6,7}}; for (int[] i : nums) { for (int j : i) { System.out.print( i[j] ); } System.out.println(); } The first row printed out fine as 0123, but I couldn't get to the second row, with the exception being thrown for j equalling 4 (therefore, i[4] does not exist).
For people having Syntax error, 'for each' statements are only available if source level is 1.5 or greater. if you are using Eclipse IDE then right click on the project, goto properties, Java Compiler, Check Enable project specific settings and set the Compiler compliance level to greater than 1.5. I solved this issue by setting it to 1.6. Hope it helps.!!
Thank you for your tutorials , there is a shortcut for print method is { in main method put these letters [ syso ] after that hold [ctrl+space ] it will show you the print method just press it , my regards Eyad
It's very early in the morning for him, so presumably he uploaded it right after he made it and the server that this is on is in a different time zone in which it was before midnight. :)
The only difference between enhanced for loop and for loop is that the enhanced for loop is inflexible compare to for loop. You can only iterate (repeat) increment in sequence in the enhanced for loop whereas you can iterate decremental or incremental in for loop without strictly following the sequence i.e. you can change it
With this lesson, I've created 2 different random number generators that add the sums of the numbers. One has a for loop that will repeat it's for loop code (with a incrementation) a random number of times, while the other uses an array with 4 random values added together. I'll share both of them for anyone who may want to use them to analyse the way the java randomiser functions (because I did see some odd similarities (for instance, the value 0 being repeated quite often compared to what you'd expect considering how low the probability of that occurring is because of all the possible values the randomiser can input)). The "completely" random code: import java.util.Random; public class RandomNumberGenerator { public static void main(String args[]){ Random num1 = new Random (); Random num2 = new Random (); int add = 0; int somenum = num1.nextInt(); for(int a = 1; a
Bucky your really good i bet you already know this but if you type "syso" and click ctrl space it will write System.out.println(); automatically for you :) continue making great vids
Don't know if you've worked it out by now, but I think total+=x is short for total = total + x, so it takes the previous total and adds the current value of x. He's just saving space.
I watched most of these 2x the first go round. Once i watched them all, following along in Eclipse, i started over again, but in stead of wiping the classes each time, i just create new methods and call them from apples.java. I comment out last tut's method calls and create a new one. For the array tuts, i have been using just one function and adding more and more methods to it. My apples class is about 386 lines right now with commenting and a few experiments of my own, as bucky encourages.
Dude Bucky's subscribers could all make a website dedicated to reviewing Bucky's videos. It could be like an open wiki type of thing, with sections such as "How to make a Table of Arrays" and "How to make an infinite for loop". It'd help the people writing it up to remember everything, plus it'd benefit those who actually read the site.
if you can loop through it somehow, meaning it implements the Iterable interface. then you can use for([class] [instance name] : [Collection instance name]) { } so its not made especially for arrays its made for any class that implements Iterable where T is any type. you can do this for arraylists as well.
@TheSamLegacy The best way to do this is to write variations of whatever you have learned. Don't copy what he does 1 to 1, just try to make your own versions of whatever he's presenting. This will force you to apply what you have learned in slightly different scenarios, which will make it stick a lot better.
Its basically saying total = total + x. You want to add on the next number to whatever you have got so far instead of replacing total with the next number
For clarification, why can't we use the array name for "total" rather than the identifier "x", for example total+= . I know it will not work, but why is this? Is it due to the limitations of the array to work with only one job assignment (working as an array holder only and not an identifer)?
Here's an example of a program using previous lessons and including up the current one . What I did is create 2 classes, the 1st class named : "forTesting" is used to get and show data from the 2nd class named "methodLists". The program gets an input from user upon how many numbers will he/she add, value of number for each array then sums it all up in the end. import java.util.Scanner; class forTesting { public static void main (String[] args) { int passValue=0; Scanner getDigit = new Scanner(System.in); System.out.print("How many numbers will you add?: "); passValue = getDigit.nextInt(); methodLists obj1 = new methodLists(); obj1.process(passValue); obj1.result(); } }//End of 1st Class import java.util.Scanner; public class methodLists { int sum=0; //instance variable public void process(int value1) { int arrayThread[] = new int[value1]; Scanner getData = new Scanner(System.in); //store data in the array for (int looper=0;looper
you know, been programing before in c# and c++ for a long time, tried to to transfer into java and it was never really my thing.now after a long break of programing at all. trying again and seriously this tutorial are so good !!! and the most important thing I really enjoy when ever u put a short cuts that I never knew exist like the \t , the if statement inside the printf and now this loop. I mean feels like I was taught programing by idiots in the past... anyway really like your videos. hope it will keep up till the end :)
@TheSamLegacy One thing i have been doing is keeping a note book for these tutorials. That way i follow along in eclipse during the video, and then afterwards redo it in pen on paper(with explanations of each thing). That has helped me tons to remember all of the info!
Can you change the values of the elements of array bucky with a for each loop? What I am thinking is that to change the element values in an array then you need to refer to the element with it's index and it seems like that isn't possible with a for each loop? Since a for each loop doesn't use indexes. I am confused about this.
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.
Is there any difference in performance/speed between this type of for loop and the standard one? I am guessing that the difference is probably negligible if there is any at all, but hey...I'm just curious :)
If you need the sum of more than 1-dimensional arrays you will have have to type [] next to your variable. int matrice [] [] = {{1},{1,2}}; // We now have a 2 dimensional matrice called "matrice" //To get the sum of the elements: for(int y[]: matrice){ for(int z:y){ } } //Then you can print the sum on your main method
what is counter in this loop? like i want to print out bucky 0 = 3 bucky 1 = 4 bucky 2 = 5 bucky 3 = 6 bucky 4 = 7 how can i print out the value of the counter ? i knew it how to do with for loop but don't knew how to do this with Enhanced for loop
Tried incorporating all the tuts into a simple game class with the functionsimport java.util.*; public class recap2 { public void guess() { Random dice = new Random(); Scanner input = new Scanner(System.in); for ( int i = 0; i < 1000; i++) { int head[] = new int[10]; int A = 0; System.out.println("Guess how many times it will land on heads out of 10"); int am = input.nextInt(); if ( am
OriginalClassTV Because he's angry that he doesn't understand the code. Otherwise he would be a helpful human being by giving some tips/tricks or even new ideas.
Brett Morris TLDR: I spent over an hour looking at the dice game because the way you did it confused me. But still NICE! This doesn't exactly simulate flipping a coin, because tails will always be atleast 1. It's a very very nice implementaion of most of what was learned don't get me wrong! But when a number is added to the value of an index if that index has already been run through by the for loop then the value of x will not change. Basically you're generating a number between 1 and 10 in an EXTREMELY complicated way (not 0 mind you which would be possible when flipping a coin) and subtracting it from the number of flips. This is a simluation broken down step by step At the beginning of index 0 a = 0 and x = 0 At the end of index 0 a = 0 and x = 0 At the beginning of index 1 a = 0 and x = 0 At the end of index 1 a = 0 and x = 0 At the beginning of index 2 a = 0 and x = 0 At the end of index 2 a = 0 and x = 0 At the beginning of index 3 a = 0 and x = 0 At the end of index 3 a = 0 and x = 0 At the beginning of index 4 a = 0 and x = 0 At the end of index 4 a = 0 and x = 0 At the beginning of index 5 a = 0 and x = 2 At the end of index 5 a = 2 and x = 2 At the beginning of index 6 a = 2 and x = 0 At the end of index 6 a = 2 and x = 0 At the beginning of index 7 a = 2 and x = 0 At the end of index 7 a = 2 and x = 0 At the beginning of index 8 a = 2 and x = 1 At the end of index 8 a = 3 and x = 1 At the beginning of index 9 a = 3 and x = 3 At the end of index 9 a = 6 and x = 3 ------------------------------------- Heads tails 6 4 It landed on heads 6 times ------------------------------------- Index 0- Value 0 Index 1- Value 1 Index 2- Value 0 Index 3- Value 0 Index 4- Value 1 Index 5- Value 3 Index 6- Value 1 Index 7- Value 0 Index 8- Value 1 Index 9- Value 3
Try adding two thing you learned in one, that what i do to help remember things, also try redoing what bucky teaches on his videos without looking back at the video, only when your done, finally just re-watch the videos that are the hardest to understand. Hope that helps
i designed a factorial program thanks to your vid! ik the time complexity aint the best...but whatever #stilllearning :D Scanner s=new Scanner(System.in); System.out.println("Enter which number's factorial you which to find out:"); int n=s.nextInt(); int fact=1; int a[]=new int[n]; for(int i=0;i
to everyone who wants to write minecraft plugins for bukkit etc. I wrote since now 5 plugins, they are even accepted on bukkit dev. -AntiEnderPick -Enlete -LastChance And all that only from tutorials to 20!
i think there is a bit of problem on this video. i don't know if it's just me, but it seems that this video buffer only until around 0:40.. i hope this got fix asap coz i can't understand the next tutorial, i mean this tut is used there right? by the way great tutorials you got there, i've just finished c++ and it really do help. thanks!
@TheSamLegacy Buy a Java book from amazon or ebay. Best way of learning programming. It contains exercises, better explanation. For me those little videos are just basic stuff. He doesn't really explain how compiler works. And what everything REALLY does. He's like: "You don't need to know that" We need to know EVERYTHING about language we will use for our projects
For those who're struggling!
It's easy to look at this type of loops as at the shopping list example.
Let's say you have an array named string shoppingList[] = {eggs, milk, bread, tuna};
Now when it comes to the loop, here's what you can do:
for (string item: shoppingList) {
System.out.println(item);
}
The output will be strings like this:
eggs
milk
bread
tuna
Basically, it's an easy way to write a for loop but you don't have to specify the length of array and increment the counter because this loop takes this data from the array . And it's also a convenient way for naming an x in a descriptive way like "item" so you know what you're accessing.
Can you help with using enhanced for loops when nested, like for 2D arrays? The best method I came up with so far is:
int[][] nums = {{0,1,2,3}, {4,5,6,7}};
for (int[] i : nums)
{
for (int j : i)
{
System.out.print( i[j] );
}
System.out.println();
}
The first row printed out fine as 0123, but I couldn't get to the second row, with the exception being thrown for j equalling 4 (therefore, i[4] does not exist).
Your code is kind of wrong, you need to fix it to be able to fix the original problem
thanks for heads up, but that was rude
you have a little mistake it should be:
String shoppingList[ ] = {"eggs", "milk", "bread", "tuna"}; :)
god bless semicolon;
The ones who are getting confused, total+=x ......is same as writing....
total = total + x
Does anyone else notice these videos were all uploaded on the same day? Dude is committed. I like it.
This is also called a "Foreach loop" if you want to google this for more examples.
So glad someone could explain this so simply, thanks a bunch
For people having Syntax error, 'for each' statements are only available if source level is 1.5 or greater.
if you are using Eclipse IDE then right click on the project, goto properties, Java Compiler, Check Enable project specific settings and set the Compiler compliance level to greater than 1.5. I solved this issue by setting it to 1.6. Hope it helps.!!
+Akansha goel thanx buddy...it worked
mine is 1.8 but I'm still getting a Syntax error... I am using a Macbook Pro 2013, not sure if that matters
thx so much it workeddd
Best java tutorial channel so far. Subscribed.
lets all appreciate how bucky always give the best names to identifiers and variables
man you convinced me that watching these tutorials wasn't a waste of time
Even after 10 years of this video I still prefer @thenewboston. Explanations are crystal clear.
That actually explains it very well. I'm pretty excited because these older tutorials are making more and more sense as I keep working on them.
A video helping people, 11 years from the future, make sense of how the enhanced for loop works. Thanks!
Tus tutoriales son excelentes, he empezado de cero y son fácil de entender, gracias por este gran aporte
Wonderfully explained how to run through the array and store each value in a variable and output the total.
I am loving loops now.
It's pretty useful to see how the various bits and pieces come together. You only really learn something like this by putting it to use in things.
Thumbs up if you are learning this so that you can eventually make an awesome game!
did you eventually make an awesome game? If you did, I doubt it was with Java
no need to try and put bigbird down, plenty of decent games can be made in java, sure you cant make anything crazy but i doubt thats what he meant
Luke Bends lol mine craft was made in java... js
oh shit rlly didn't know, how cool but point still stands, java is awesome
MC was made with Java but everyone would be happy if it wasn't cause C++ is more efficient when it comes to making video games.
Your Java Tutorial is a life saver! Those boring school books.. Your videos is just the best!
Keep up the good work!
Got AP exam tomorrow, thx for the video! Nice and quick review
I wish my school had that class. Hope you did good!
My text book left me totally confused. Thanks for making this easy to understand.
bucky u r really genius to make us explain all these things an that to so easily.
Thank you for your tutorials , there is a shortcut for print method is { in main method put these letters [ syso ] after that hold [ctrl+space ] it will show you the print method just press it , my regards Eyad
This is a lot easier in python.
"one for loop to loop them all..."
Well I guess "one does not simply walk into programming."
It's very early in the morning for him, so presumably he uploaded it right after he made it and the server that this is on is in a different time zone in which it was before midnight. :)
Not surprising, he is a Java God. He probably programmed a time machine so that he uploads it early!
So your at Java Tutorial 31, and your coding has improved a lot!
i dont find some one very kind like you everyday
Old but getting Gold bro, well explained ❤❤
this tutorial series is awesome! thank you dude
Finally understood this, thank you!
The only difference between enhanced for loop and for loop is that the enhanced for loop is inflexible compare to for loop. You can only iterate (repeat) increment in sequence in the enhanced for loop whereas you can iterate decremental or incremental in for loop without strictly following the sequence i.e. you can change it
Good luck to all you other guys (and girls) who have made it this far. You're learning something genuinely useful!
TO CLEAR IT OUT it is the same as this:
for(int counter=0;counter
With this lesson, I've created 2 different random number generators that add the sums of the numbers. One has a for loop that will repeat it's for loop code (with a incrementation) a random number of times, while the other uses an array with 4 random values added together. I'll share both of them for anyone who may want to use them to analyse the way the java randomiser functions (because I did see some odd similarities (for instance, the value 0 being repeated quite often compared to what you'd expect considering how low the probability of that occurring is because of all the possible values the randomiser can input)).
The "completely" random code:
import java.util.Random;
public class RandomNumberGenerator
{
public static void main(String args[]){
Random num1 = new Random ();
Random num2 = new Random ();
int add = 0;
int somenum = num1.nextInt();
for(int a = 1; a
Believe it or not. You made my (and probably also others) day! Thanks for the smile. :-)
Trivia:
This enhanced for loop is also called the for each loop.
You could also read "for(int x : bucky) {} " as "for each integer x in bucky..."
for(int x: bucky) -> is equivalent to -> foreach(int x in bucky) in C# -> is equivalent to -> foreach($bucky as $x) in PHP
Bucky your really good
i bet you already know this but if you type "syso" and click ctrl space it will write System.out.println(); automatically for you :)
continue making great vids
dude.thanks for all your tutorials.. they're pretty useful to me! thanks a lot!!!
Don't know if you've worked it out by now, but I think total+=x is short for total = total + x, so it takes the previous total and adds the current value of x. He's just saving space.
Love your tutorials Bucky. You are the best!
I see it like a shortcut for the regular for loop, Thanks bucky!
I watched most of these 2x the first go round.
Once i watched them all, following along in Eclipse, i started over again, but in stead of wiping the classes each time, i just create new methods and call them from apples.java.
I comment out last tut's method calls and create a new one.
For the array tuts, i have been using just one function and adding more and more methods to it.
My apples class is about 386 lines right now with commenting and a few experiments of my own, as bucky encourages.
Dude Bucky's subscribers could all make a website dedicated to reviewing Bucky's videos. It could be like an open wiki type of thing, with sections such as "How to make a Table of Arrays" and "How to make an infinite for loop". It'd help the people writing it up to remember everything, plus it'd benefit those who actually read the site.
Easily and nicely explained; thank you.
So enhanced for loops are for arrays?? Am i right?
yes it is especially made for arrays. This can be called a "For Each" Loop, because it is looping in each and every array element.
Thanks :-)
if you can loop through it somehow, meaning it implements the Iterable interface. then you can use
for([class] [instance name] : [Collection instance name])
{
}
so its not made especially for arrays its made for any class that implements Iterable where T is any type.
you can do this for arraylists as well.
Not only array, also for LinkedList.
Basically anything with storing list type!
just 3 array tutorials to go
But I love arrays! D:
@TheSamLegacy The best way to do this is to write variations of whatever you have learned. Don't copy what he does 1 to 1, just try to make your own versions of whatever he's presenting. This will force you to apply what you have learned in slightly different scenarios, which will make it stick a lot better.
Thank you Bucky, great tutorials, nice tempo...
only Bucky can come up with something as creative as DOG WOOD.
I understood this video easily thank you for these tutorials!
Simple and well explained. Thank you!
Its basically saying total = total + x. You want to add on the next number to whatever you have got so far instead of replacing total with the next number
As usual, THANKS i am learning a lot :)
mac's version of aero snap is called cinch if you wanna follow along on the apple side ;)
For clarification, why can't we use the array name for "total" rather than the identifier "x", for example total+= . I know it will not work, but why is this? Is it due to the limitations of the array to work with only one job assignment (working as an array holder only and not an identifer)?
Here's an example of a program using previous lessons and including up the current one .
What I did is create 2 classes, the 1st class named : "forTesting" is used to get and show data from the 2nd class named "methodLists". The program gets an input from user upon how many numbers will he/she add, value of number for each array then sums it all up in the end.
import java.util.Scanner;
class forTesting {
public static void main (String[] args)
{
int passValue=0;
Scanner getDigit = new Scanner(System.in);
System.out.print("How many numbers will you add?: ");
passValue = getDigit.nextInt();
methodLists obj1 = new methodLists();
obj1.process(passValue);
obj1.result();
}
}//End of 1st Class
import java.util.Scanner;
public class methodLists {
int sum=0; //instance variable
public void process(int value1)
{
int arrayThread[] = new int[value1];
Scanner getData = new Scanner(System.in);
//store data in the array
for (int looper=0;looper
Oh, Why thank you kind sir. (laughs in a polite sirly fashion)
all the vedios are really helpfull......thanks to bucky.......
THANKS FOR ALL YOUR VIDEOS!! You are a massive help thank you so much!! :D
you know, been programing before in c# and c++ for a long time, tried to to transfer into java and it was never really my thing.now after a long break of programing at all. trying again and seriously this tutorial are so good !!! and the most important thing I really enjoy when ever u put a short cuts that I never knew exist like the \t , the if statement inside the printf and now this loop. I mean feels like I was taught programing by idiots in the past... anyway really like your videos. hope it will keep up till the end :)
Did you finish it already?? :D
Did you finish it already?? :D
that's why you should learn c before c# or c++
Beautiful, just beautiful
Thank you very much for your explanations!
You can take notes so that you can always go back and review. That is what I did :)
Thanks for your time and help!
keep up the good work bucky
Weird how they never taught us this type of loop in school
no time to teach in school. limited number of lessons to teach, so teachers can only teach important stuff
They don't want us to become too powerful and overthrow them one day.
@TheSamLegacy One thing i have been doing is keeping a note book for these tutorials. That way i follow along in eclipse during the video, and then afterwards redo it in pen on paper(with explanations of each thing). That has helped me tons to remember all of the info!
Can you change the values of the elements of array bucky with a for each loop? What I am thinking is that to change the element values in an array then you need to refer to the element with it's index and it seems like that isn't possible with a for each loop? Since a for each loop doesn't use indexes. I am confused about this.
What is the difference between the enhanced for in Java versus the ForEach in Powershell? Or am I just overthinking it and they're the same thing?
thanks again man you make it so easy
I understood it !! thanks for the video mate :) cheers !
thank you for your tutorails . i learn a lot
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.
Thanks! This clarified things.
Just in case anyone watching this tutorial is already proficient in other programming languages, this is the equivalent of a "for each" loop.
Is there any difference in performance/speed between this type of for loop and the standard one?
I am guessing that the difference is probably negligible if there is any at all, but hey...I'm just curious :)
Did the array declaration changed?
Is it the same to declare an array like
```int[] bucky = {}```
If you need the sum of more than 1-dimensional arrays you will have have to type [] next to your variable.
int matrice [] [] = {{1},{1,2}}; // We now have a 2 dimensional matrice called "matrice"
//To get the sum of the elements:
for(int y[]: matrice){
for(int z:y){
}
}
//Then you can print the sum on your main method
thank you bucky ;) helped me a lottt
what is counter in this loop? like i want to print out
bucky 0 = 3
bucky 1 = 4
bucky 2 = 5
bucky 3 = 6
bucky 4 = 7
how can i print out the value of the counter ? i knew it how to do with for loop but don't knew how to do this with Enhanced for loop
Tried incorporating all the tuts into a simple game
class with the functionsimport java.util.*;
public class recap2 {
public void guess() {
Random dice = new Random();
Scanner input = new Scanner(System.in);
for ( int i = 0; i < 1000; i++) {
int head[] = new int[10];
int A = 0;
System.out.println("Guess how many times it will land on heads out of 10");
int am = input.nextInt();
if ( am
***** I liked it, why diss him.
OriginalClassTV Because he's angry that he doesn't understand the code. Otherwise he would be a helpful human being by giving some tips/tricks or even new ideas.
Brett Morris
TLDR: I spent over an hour looking at the dice game because the way you did it confused me. But still NICE!
This doesn't exactly simulate flipping a coin, because tails will always be atleast 1. It's a very very nice implementaion of most of what was learned don't get me wrong! But when a number is added to the value of an index if that index has already been run through by the for loop then the value of x will not change. Basically you're generating a number between 1 and 10 in an EXTREMELY complicated way (not 0 mind you which would be possible when flipping a coin) and subtracting it from the number of flips.
This is a simluation broken down step by step
At the beginning of index 0 a = 0 and x = 0
At the end of index 0 a = 0 and x = 0
At the beginning of index 1 a = 0 and x = 0
At the end of index 1 a = 0 and x = 0
At the beginning of index 2 a = 0 and x = 0
At the end of index 2 a = 0 and x = 0
At the beginning of index 3 a = 0 and x = 0
At the end of index 3 a = 0 and x = 0
At the beginning of index 4 a = 0 and x = 0
At the end of index 4 a = 0 and x = 0
At the beginning of index 5 a = 0 and x = 2
At the end of index 5 a = 2 and x = 2
At the beginning of index 6 a = 2 and x = 0
At the end of index 6 a = 2 and x = 0
At the beginning of index 7 a = 2 and x = 0
At the end of index 7 a = 2 and x = 0
At the beginning of index 8 a = 2 and x = 1
At the end of index 8 a = 3 and x = 1
At the beginning of index 9 a = 3 and x = 3
At the end of index 9 a = 6 and x = 3
-------------------------------------
Heads tails
6 4
It landed on heads 6 times
-------------------------------------
Index 0- Value 0
Index 1- Value 1
Index 2- Value 0
Index 3- Value 0
Index 4- Value 1
Index 5- Value 3
Index 6- Value 1
Index 7- Value 0
Index 8- Value 1
Index 9- Value 3
how can i fix tht problam
Syntax error, 'for each' statements are only available if source level is 1.5 or greater
i love he had to think about which number this was, "hi and welcome to uh..lets see...31st tutorial"
0:03
I think this is "for x in bucky" in python.
YankeeSpirit Or JS
+YankeeSpirit * for every x in bucky, do -statement-
Tis true
@thenewboston Thanks for that trivia but is this limited only to one dimensional array?
for everybody's kind information , it's called a FOREACH Loop
Try adding two thing you learned in one, that what i do to help remember things, also try redoing what bucky teaches on his videos without looking back at the video, only when your done, finally just re-watch the videos that are the hardest to understand. Hope that helps
i designed a factorial program thanks to your vid! ik the time complexity aint the best...but whatever #stilllearning :D
Scanner s=new Scanner(System.in);
System.out.println("Enter which number's factorial you which to find out:");
int n=s.nextInt();
int fact=1;
int a[]=new int[n];
for(int i=0;i
a very interesting construct!
I wish you provided sample questions that may use this array loop at end of video or in description or something
to everyone who wants to write minecraft plugins for bukkit etc.
I wrote since now 5 plugins, they are even accepted on bukkit dev.
-AntiEnderPick
-Enlete
-LastChance
And all that only from tutorials to 20!
An array called dogwood?
Can you rely on some order in which these iterations are processed?
Know a lot you do. your master, is who I wonder.
i think there is a bit of problem on this video. i don't know if it's just me, but it seems that this video buffer only until around 0:40.. i hope this got fix asap coz i can't understand the next tutorial, i mean this tut is used there right?
by the way great tutorials you got there, i've just finished c++ and it really do help. thanks!
morning wood sounds practical
Great tutotial! :)
thanks , I have just learn new easy way to sum up array elements
@TheSamLegacy
Buy a Java book from amazon or ebay.
Best way of learning programming. It contains exercises, better explanation.
For me those little videos are just basic stuff. He doesn't really explain how compiler works. And what everything REALLY does. He's like: "You don't need to know that"
We need to know EVERYTHING about language we will use for our projects
Was Syso Ctrl + Space not available when Bucky was making these tutorials?
Thank you, this helps a lot