This is the best Java tutorial for beginners, so you can learn Java and English in one hit. Please keep going! I vote for Java advance tutorial. Thanks a lot Bro
At his time I'm trying to learn a bit of Java so I can have a better chance at being a programmer in my robotics club at school, but I have struggled way too much, and it's ironic because I learned the basics of c# before Java. Thanks for making this since it can help me a bit with the learning process.
🎯 Key Takeaways for quick navigation: 00:30 🔄 *For loops in Java execute a block of code a limited number of times, unlike while loops which can continue infinitely.* 00:45 🔄 *For loops iterate a known number of times; the number of iterations is defined before the loop begins.* 00:59 🔄 *To create a for loop in Java, use the `for` keyword followed by parentheses containing initialization, condition, and iteration statements, then a block of code in curly braces.* 01:50 🔄 *The three parts of a for loop in Java are the index declaration (often `int i = 0;`), the condition for continuation (`i = 0`, and decrement the index (`i--`), then print a message like "Happy New Year" outside the loop.* 03:17 🔄 *You can increment or decrement the index by more than one in a for loop, e.g., `i -= 2` to count down by 2.* 03:30 🔄 *Optionally, you can move the increment/decrement statement inside the for loop, which functions the same as having it in the initialization part.*
For loop: repeting a block of code limited number of times. for(counter, condition, increment or decrement){ BLOCK OF CODE THAT RUNS IF CONDITION IS TRUE } eg: int i; for(i=0;i
Didn't know what you meant exactly but here is what I came up with and I hope this is what you meant: import java.util.Random; public class Main { public static void main(String[] args) {
Random random = new Random(); int i;
for( i = random.nextInt(11); i>=0;) { System.out.println(i); break; } System.out.println("Happy New Year!"); } } It will generate a random number between 0 to 10 before saying "Happy New Year!"
As far as I know, there isn't any difference. They just make your code more readable, since a person would have a certain understanding of the purpose of your loop just by seeing if it's "for" or "while".
/*Brandon (Insert last name here) *March 28, 2021 *For Loops */ public class ForLoops { public static void main(String[] args) { for (int i = 0; i = 0; i--) { System.out.println(i); } for (int i = 10; i >= 0; i-=2) { System.out.println(i); } }//end of main }//end of class
public class Main {
public static void main(String[] args) {
// for loop = executes a block of code a limited amount of times
for(int i=10; i>=0; i--) {
System.out.println(i);
}
System.out.println("Happy new year!");
}
}
Thx
im using jdoodle since my laptop is kinda dying
i just wanna asked why it didn't print my "for loop"?
your explanation is more easy to understand than what my prof taught me thank you so much BroCodez!
My bro is killin the teaching! Relaxed way of learning and great detail. Please upload more videos on loops with interesting examples
This is the best Java tutorial for beginners, so you can learn Java and English in one hit. Please keep going! I vote for Java advance tutorial. Thanks a lot Bro
When get stuck on java, watch bro code videos! ❤
At his time I'm trying to learn a bit of Java so I can have a better chance at being a programmer in my robotics club at school, but I have struggled way too much, and it's ironic because I learned the basics of c# before Java. Thanks for making this since it can help me a bit with the learning process.
Thank u bro this helped me a lot in understanding the for loop concept crystal clear
I'm currently in 9th standard and I'm from INDIA
I like the short format of ur videos and combining them with other sources
🎯 Key Takeaways for quick navigation:
00:30 🔄 *For loops in Java execute a block of code a limited number of times, unlike while loops which can continue infinitely.*
00:45 🔄 *For loops iterate a known number of times; the number of iterations is defined before the loop begins.*
00:59 🔄 *To create a for loop in Java, use the `for` keyword followed by parentheses containing initialization, condition, and iteration statements, then a block of code in curly braces.*
01:50 🔄 *The three parts of a for loop in Java are the index declaration (often `int i = 0;`), the condition for continuation (`i = 0`, and decrement the index (`i--`), then print a message like "Happy New Year" outside the loop.*
03:17 🔄 *You can increment or decrement the index by more than one in a for loop, e.g., `i -= 2` to count down by 2.*
03:30 🔄 *Optionally, you can move the increment/decrement statement inside the for loop, which functions the same as having it in the initialization part.*
Amazing free content, the best course that I found on the internet.
You are a legend and my hero. Am learning java for automation :)
Dude thank you so much for this channel and all these lessons.
I like the way you're spontaneous while talking bro !!
You are a lifesaver, Bro!
passing my java class thanks to you Bro :)
Bite-sized education for the layman citizen
"for" loop understood. 13th. Thank you, ma Bro Sensei!
We're going to get real close over these next 6 months and beyond
Thanks for the tutorial!
Thanks sir
bruhh i did the whole sylabus in less than 30 mins thank you bro
thank you, this helped me a lot
Thanks, Bro!
Thanks, Bro! ☕
Thank you👏
Bro I’m in a Cisp class and these videos savoring me because I am so lost
you are amazing!
you're a beastttt
Better explanation than my prof at university
very informative sir thank you.....
Thanks you for a great job, Bro
great content, really helpful
Thank you for the video 💙💙💙💙
THANK YOU
For loop: repeting a block of code limited number of times.
for(counter, condition, increment or decrement){
BLOCK OF CODE THAT RUNS IF CONDITION IS TRUE
}
eg: int i;
for(i=0;i
AWESOME
I am the biggest fan of you
Thanks! :D
Thankss Broo !!!
learnt from you
again
❤❤❤
using this to pass my java final
thx 4 vid bro !
ty bro
great content
Thanks for sharing x
thank you
Never Stop Uploading videos Plz
Nice
Great Video!
Great job bro
following you to the end
Thanks ma bro!
God Bless you Bro +11
Thanks, Bro 06/01/2024
Thanks bro I want to get copies of your codes more and more can I get it?
Thank you
Thanks
Thanks bro 💯
ayo greattttt
Nice.
thanks
Very good
thanks bro
my dream is to get in faang
good job
What would happen if you set the second part to null?
Брат спасибо
yessir
does work for me for some reason it just spams 1 million zero`s
Me too
Is there a way to make it so that it goes up or down an increment every time the program is run?
Didn't know what you meant exactly but here is what I came up with and I hope this is what you meant:
import java.util.Random;
public class Main {
public static void main(String[] args) {
Random random = new Random();
int i;
for( i = random.nextInt(11); i>=0;) {
System.out.println(i);
break;
}
System.out.println("Happy New Year!");
}
}
It will generate a random number between 0 to 10 before saying "Happy New Year!"
How do i find the min and max value on a for loop
Happy New Year 2022
What do you do when the code keeps running forever? My computer almost crashed because the console kept making more and more numbers infinately
I know I am a month late but in case you ever need it there is a red square in the upper right of the console, click it to stop running
loop only use for Int Variable ?
dropped a comment
Is it necessary for the for loop to be inside braces
nice but pls help what is diferent between while (i == 10){i++;} and for(int i; i >=0; i++)
As far as I know, there isn't any difference. They just make your code more readable, since a person would have a certain understanding of the purpose of your loop just by seeing if it's "for" or "while".
👍
☺
still hanging there and taking notes on google sldies
comment for algorithm!
gg
BROOOOOOOOOOOOOOOOOO
starting 00:22
/*Brandon (Insert last name here)
*March 28, 2021
*For Loops
*/
public class ForLoops {
public static void main(String[] args) {
for (int i = 0; i = 0; i--) {
System.out.println(i);
}
for (int i = 10; i >= 0; i-=2) {
System.out.println(i);
}
}//end of main
}//end of class
6 february
BRo is bro
Broski
Hi
three parts to this 4 loop lol
LOOOOOOOOOOOOOOOPS
Bro
hello
"Video 13"
OHAHA
vedio -13
bro
16
G