import java.util.Scanner; public class Main { public static void main(String[] args) {
// nested loops = a loop inside of a loop
Scanner scanner = new Scanner(System.in); int rows; int columns; String symbol = "";
System.out.println("Enter # of rows: "); rows = scanner.nextInt(); System.out.println("Enter # of columns: "); columns = scanner.nextInt(); System.out.println("Enter symbol to use: "); symbol = scanner.next();
@@armagedon3505 i guess you already found your answer. still leaving this comment for others to find out. the count starts from 0. hence when the row number will be entered 4, it will count 5. cause 0,1,2,3,4. He wanted the exact number 4. That's why he choose i=1. if you choose i=0, the row number for 4 row will be 3.
I understood the previous videos quickly, so I thought I’d understand nested loops just as easily. Because of that I didn’t pay full attention to Bro’s explanation and ended up not understanding them, After about a week I watched the video again and listened carefully to Bro, and I understood it immediately. Thank you Bro
Great video. A clearer illustration of nested loops is a mechanical clock. The second hand ticks every second. The minute ticks every minute or every 60 ticks or 1 loop of the second hand. The same for the hour hand. A little modification I would suggest is to put the println() to the end instead of the start of the inner loop. for (int i = 1; i
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
Thank you so much. I don't really understand how the nested loop works, I want to fully understand how the program creates rows and columns. by the next time I see my comment, this should be different. Thanks bro
sorry for the late reply but next(); can only be used to input strings but not spaces, so if you want to input a word, you can use next(); nextLine(); can be used to input full lines and more than one word.It can read spaces as well. So, in the video, for example they used next(); to input the symbol as it is only on word(or character)
How does this work? I can only imagine rows and columns leave an empty space in relation to user input. Thereafter the symbol can take the shape left by the user input. However, how does tha machine know that after the first row that we dont only want the first row to have 5 symbols? But it continuously does that downwards? Btw when we enter our number for the condition of "print" does this make and count space horizontally while the "println" counts and makes space vertically?
print does not create a new line so thats why it goes horizontal. As per your other question, the machine knows this because of the system.out.println so the machine first puts in the amount of the symbol you want per line then it creates another row(line) and simply does it over and over again until loop is finished
Why we do no put a scanner.nextLine(); after rows = scanner.nextInt(); and columns = scanner.nextInt(); . Since scanner.nextInt() can only read integer and it won't escape the line, I am confused.
@@UltraSolarGod Scanner scanner = new Scanner(System.in); int rows; int columns; String symbol1 = ""; String symbol2 = ""; System.out.println("Enter # of rows: "); rows = scanner.nextInt(); System.out.println("Enter # of columns: "); columns = scanner.nextInt(); System.out.println("Enter first symbol to use: "); symbol1 = scanner.next(); System.out.println("Enter second symbol to use: "); symbol2 = scanner.next(); for(int i=1; i
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// nested loops = a loop inside of a loop
Scanner scanner = new Scanner(System.in);
int rows;
int columns;
String symbol = "";
System.out.println("Enter # of rows: ");
rows = scanner.nextInt();
System.out.println("Enter # of columns: ");
columns = scanner.nextInt();
System.out.println("Enter symbol to use: ");
symbol = scanner.next();
for(int i=1; i
Thanks for this am wishing for your channel to reach million soon
for(int i=1; i
@@armagedon3505 i guess you already found your answer. still leaving this comment for others to find out. the count starts from 0. hence when the row number will be entered 4, it will count 5. cause 0,1,2,3,4. He wanted the exact number 4. That's why he choose i=1. if you choose i=0, the row number for 4 row will be 3.
😊
I am having trouble understanding nested loops so I will watch this video on repeat until I understand.
practice makes perfect
You have the gift of teaching.
One of the best sample codes I've seen for this series. That's some cool logic you used.
I understood the previous videos quickly, so I thought I’d understand nested loops just as easily. Because of that I didn’t pay full attention to Bro’s explanation and ended up not understanding them, After about a week I watched the video again and listened carefully to Bro, and I understood it immediately.
Thank you Bro
Dude, you teaching me better than my teacher could!!!
Thank you so much!
Great video. A clearer illustration of nested loops is a mechanical clock. The second hand ticks every second. The minute ticks every minute or every 60 ticks or 1 loop of the second hand. The same for the hour hand.
A little modification I would suggest is to put the println() to the end instead of the start of the inner loop.
for (int i = 1; i
This guy is really genius, java with this guy is like a piece of cake much love god bless bro
Bro you're a lifesaver, an actual one. Nice Tutorials
BOOM!!!! BEST UA-camR
Deserves the Gold Button
bro is god level teacher ,who made me understand same concept in 6:00 minutes which i'm struggling to learn for 2 years
This guy is underrated asf!
I do follow and watch your tutorials. Perfect and simple explanation. Thank you Bro !!!
You’re doing the lords work bro
I bought udemy course and got bored now I am watching the same course from you thx bro
Best programing guides on youtube
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
This actually made sense! Thank you!!!
Thank you so much. I don't really understand how the nested loop works, I want to fully understand how the program creates rows and columns. by the next time I see my comment, this should be different.
Thanks bro
This video is very useful! Thank you for make this video bro😃😃😃
Nested loops completely undestood. 14th. Thank you, ma Bro Sensei!
Publlic class Amazing video(){
}
Well done !!!!
awesome tutorials
Bro has the best examples
whats ythe difference between nextLine() and just next (). You have used both for strings?
sorry for the late reply but
next(); can only be used to input strings but not spaces, so if you want to input a word, you can use next();
nextLine(); can be used to input full lines and more than one word.It can read spaces as well.
So, in the video, for example they used next(); to input the symbol as it is only on word(or character)
@@FatimaAli-fr4bo thanks for the explanation!!
Great tutorial
Thx for the tutorial!
quick question, how does it know to print the rows horizontally and the columns vertically?
because at the line
System.out.print(symbol);
is only a print statement, if you used
System.out.println(symbol);
it would print them vertically
4:25
awesome explonation! thank you!
question why this time you do not need to use println() to clear out the next int still bit confused about
Thanks!
This is tip and trick for programming language.
for general use is i the x-axis and j the y-axis would i be right as this would be the same as maths
Amazing video as always, Bro!
Good
Why was the System.out.println(); in the for loop block so necessary that it's changing the whole output?
its makes colums go under
Nice
My question is:
"Why the inner for loop variable "j" resets every "i" variable update but i keep growing till the condition is false (i
good bro
thx for explanation
thanks for your help!!
Hey bro, you are so wonderful.
thank you very much
Βρόχοι επανάληψης ενσωματωμένοι (nested), μέσα σε άλλους βρόχους επανάληψης.
Super video!
thx 4 vid bro !
How does this work? I can only imagine rows and columns leave an empty space in relation to user input. Thereafter the symbol can take the shape left by the user input. However, how does tha machine know that after the first row that we dont only want the first row to have 5 symbols? But it continuously does that downwards?
Btw when we enter our number for the condition of "print" does this make and count space horizontally while the "println" counts and makes space vertically?
print does not create a new line so thats why it goes horizontal. As per your other question, the machine knows this because of the system.out.println so the machine first puts in the amount of the symbol you want per line then it creates another row(line) and simply does it over and over again until loop is finished
Thanks, Bro! ☕
thank you 😊
Thank you man 💙💙💙💙
Nice.
0:04 i find out that "nested loop work in java" u say is kinda like melody here XD
Thank you Bro
thank you 😊😊😊
thanks, bro!
You the man
thanks bro
how can i make it with boolean for example
Cool Bro, thanks :)
OMG! Where are the captions???
ty bro
loop-ception
Thanks
Thanks brooo
'columns cannot be resolved to a variable' how do i fix this?
Hey I copied Everything but it doesn't work it only displays rows
Check the print / println
Why we do no put a scanner.nextLine(); after rows = scanner.nextInt(); and columns = scanner.nextInt(); . Since scanner.nextInt() can only read integer and it won't escape the line, I am confused.
Vazha
👌
Merci
thanks
Thanks, Bro 06/01/2024
❤❤❤
What should I do if I wanna 2 diff. symbols ,like " X & O " !!
Use one more Symbol scanner name.....( like : symbol2 )
@@Google_Engineer but how to print it can you give use the code ?? plz _/\_
@@UltraSolarGod Scanner scanner = new Scanner(System.in);
int rows;
int columns;
String symbol1 = "";
String symbol2 = "";
System.out.println("Enter # of rows: ");
rows = scanner.nextInt();
System.out.println("Enter # of columns: ");
columns = scanner.nextInt();
System.out.println("Enter first symbol to use: ");
symbol1 = scanner.next();
System.out.println("Enter second symbol to use: ");
symbol2 = scanner.next();
for(int i=1; i
danke
Hey bro code I have a question is this efficient?
6 february
14 thx
God Bless you +12
that 's some good shit.
comment for algorithm!!
My code is being printed vertically
Same to do now ??
❤
Yeah!
😍😍😍😍
yes, learnt
😁😁
wild
😃
Nested loops are so confusing 😭
"Video 14"
comment for stats
BRO IS BRO
feed the baby bird
17
fellow human beings XD lol
comment
Uhjj
pop