public class Main { public static void main(String[] args) {
// if statement = performs a block of code if it's condition evaluates to be true
int age = 75;
if(age==75) { System.out.println("Ok Boomer!"); } else if(age>=18) { System.out.println("You are an adult!"); } else if(age>=13) { System.out.println("You are a teenager!"); } else { System.out.println("You are not an adult!"); }
You have explained things so much better than my coding instructor! There has never been an explanation as to "why" such operations are used, and how they can be used incorrectly, take for example the one equal sign as an assigned vs the two equal signs to compare. Now I know why my code spat out a bunch of errors. You just got yourself a subscriber sir!
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
I made a coin flip code: import java.util.Random; public class Main { public static void main(String[] args) { Random random = new Random(); int x = random.nextInt(2)+1; if(x==1){ System.out.println("Heads"); } else { System.out.println("Tails"); } } }
why is it saying "C:\Users\ok\OneDrive\Documents\main.java:1: error: class Main is public, should be declared in a file named Main.java public class Main { ^ 1 error Tool completed with exit code 1"
for me the code dosnt work, it just repeat the number i input and dosnt even ask me the question Syntax Error: invalid syntax file "" line 1 ^ how do i fix this?
public class Main {
public static void main(String[] args) {
// if statement = performs a block of code if it's condition evaluates to be true
int age = 75;
if(age==75) {
System.out.println("Ok Boomer!");
}
else if(age>=18) {
System.out.println("You are an adult!");
}
else if(age>=13) {
System.out.println("You are a teenager!");
}
else {
System.out.println("You are not an adult!");
}
}
}
😮
You have explained things so much better than my coding instructor! There has never been an explanation as to "why" such operations are used, and how they can be used incorrectly, take for example the one equal sign as an assigned vs the two equal signs to compare. Now I know why my code spat out a bunch of errors. You just got yourself a subscriber sir!
Oh my god you are wasting money on that proof
my prof struggled to explain this to us today and you did it in 6 minutes in such a clear way
how 💀
but yeah i agree
whuh
how is that possible?💀
I can't wait to get to the more complicated stuff and witness how Bro Code makes it a cake walk
I wish Bro Code was my professor
well he kinnda is haha
True
i mean your not wrong!@@nikolanovakovic4150
He is
Your explanations are so good, thanks. I'm new to coding and when I need a quick refresher on something I know where to come to.
finally, after all these episodes, you make an if statement tutorial
haha it's a remake tho
@@BroCodez what is the illegal character 200f or something like that
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
We learned if and else if statements in my Java Bootcamp, but this explained them much better. Thanks!
This video gave me the missing piece to complete my assignment, thanks Bro! 💯
I have a class test in exactly 20 minutes. And bro actually saved my life. Thank you i owe my life to you
bro is too good he explained the whole thing in 6 min
This will help me for my mid term exams later :)
"Ok Boomer!"
I was caught off guard there buddy. I almost laughed in the middle of the night.
all your videos are really great Brev. really cool :0 it helps me to learn java again with interest.
Thank you brother for all of your work.
How come I havent seen you before. Thanks a lot man! you help me greatly.!
Best channel ever!
You are real bro, thanks for the helpful video again ;)
your videos are so so good. thanks for your help
So, else statement. I've done with Scanner, learned from you. 9th. Thank you, ma Bro Sensei!
Coming from knowing java script I now know they both have java in the name. Even for loops work the same.
Thank you!!! now it makes sense.
Thanks for your tutorial.
Thank you for this !
Thank you so much bro very nice 😊❤
bros for life and thanks for the playlist
Thank you brother thank you if you need money allah give U A Billuner .!!!
KAKASHI AFTER RETIREMENT AS HOKAGE 🚶🏻🧙 LOL BRO KEEP IT UP .
Amazing! Thanks Bro
Smashed subscribed button Bro!! liked your way of teaching and accent. :)
Hello! What website/app are you using for coding?
@BroCodez is it wrong to write
The value before the variable in the if statement for example
If( 20>iage)
thx you helped so muchh😀
Scanner method:
import java.util.Scanner;
public class Main{
public static void main(String[] args) {
Scanner scannerr = new Scanner(System.in);
System.out.print("What's your age?");
int age = scannerr.nextInt();
if (age >= 70) {
System.out.println("You're an elder! It would be cool if you choose not to drive");
} else if (age >= 18){
System.out.println("You can drive little boy");
} else {
System.out.println("You can't drive until you reach the reach the age 18 y/o");
}
// ~~~~scanner end~~~~
scannerr.close();
}
}
Thank you so much bro I love you, if i could kiss you right now i would.
Thanks! I was Struggling how to take number from user!
Thank you!
Great tutorial bro
amazing job, bro!
I noticed you deleted the char and string topic in the playlist?
Thank you again 💙💙
Awesome Sauce!
GUI method:
import javax.swing.JOptionPane;
public class Main{
public static void main(String[] args) {
int age = Integer.parseInt(JOptionPane.showInputDialog("What's your age?"));
if (age >= 18) {
JOptionPane.showMessageDialog(null, "You can drive!");
} else {
JOptionPane.showMessageDialog(null, "You can't drive!");
}
}
}
Great video
Thank you👍
you are amazing!
thank bro very much
thx 4 vid bro
I like your video
Love you bro!
Your voice sounds exactly like Technoblade! : )
Thank you bro
The best!!
Thanks bro!
thanks!!
Good video !!!!
Thanks Bro
I made a coin flip
code:
import java.util.Random;
public class Main {
public static void main(String[] args) {
Random random = new Random();
int x = random.nextInt(2)+1;
if(x==1){
System.out.println("Heads");
}
else {
System.out.println("Tails");
}
}
}
TY BRO
Thank you bro)
Thanks
Thank you
Thank!
why is it saying "C:\Users\ok\OneDrive\Documents\main.java:1: error: class Main is public, should be declared in a file named Main.java
public class Main {
^
1 error
Tool completed with exit code 1"
Nice bro!
Thank you Chad
One question: If your age is 19, You are a teenager or an adult?
Adult
Professor Bro Code to the rescue
thx! learnt
rewqatch
Rewatch
ty bro
Programmer: "int age;"
Me, a intergalactic eldritch monstrosity who just turned 2,147,483,648 years old: 😢
thanks
for me the code dosnt work, it just repeat the number i input and dosnt even ask me the question
Syntax Error: invalid syntax
file "" line 1
^
how do i fix this?
Ακόμα ένα καλό video για τη γλώσσα Java.
what
amazing
God Bless you Bro + 6
in 3:13 why it didn't print the bode of if and the body of else if is it because of the curly braces ?
Is it possible to join both if statement and switch case?
Like your didactics
tks bro
what if you have multiple if statements
dropping a comment for the youtube algorhitm
I f I watch this video, I will learn how to deal with if. If not, than not. :)
i cant seem to run it, the last "}" says "Syntax error , insert "}" to complete Classbody"
Nice
nice bro
Nice.
I love u bro
what a chad🗿
Great job!!!
Var x= y;
If ( ) { Sys..( ); }
Else if ( ) { Sys... ( ); }
Else if ( ) { Sys...( ); }
import java.util.Scanner;
public class main {
public static void main(String[] args) {
int age;
Scanner scanner = new Scanner(System.in);
System.out.println("Enter your age :");
age= scanner.nextInt();
if(age>=18) {
System.out.println("You are an adult!");
}
else {
System.out.println("You are not an adult1");
}
}
}
Don't forge to close the Scanner, bro.
scanner.close(); or Scanner.close(); I don't remember lol
this one just to defeat the algorithm
your jokes are funny
Thanks Bro, 05/31/2024
maybe I should stop going to college school and should watch your video instead....
Random comment :)
"ok boomer" I explode jajajajaja
cool
hey bro!
👍
great video brother