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"); } } }
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?
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"
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!");
}
}
}
😮
Bro out put there was int cannot be converted to boolean
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?💀
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
I can't wait to get to the more complicated stuff and witness how Bro Code makes it a cake walk
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
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
I have a class test in exactly 20 minutes. And bro actually saved my life. Thank you i owe my life to you
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.
"Ok Boomer!"
I was caught off guard there buddy. I almost laughed in the middle of the night.
We learned if and else if statements in my Java Bootcamp, but this explained them much better. Thanks!
bro is too good he explained the whole thing in 6 min
This video gave me the missing piece to complete my assignment, thanks Bro! 💯
This will help me for my mid term exams later :)
all your videos are really great Brev. really cool :0 it helps me to learn java again with interest.
How come I havent seen you before. Thanks a lot man! you help me greatly.!
So, else statement. I've done with Scanner, learned from you. 9th. Thank you, ma Bro Sensei!
KAKASHI AFTER RETIREMENT AS HOKAGE 🚶🏻🧙 LOL BRO KEEP IT UP .
Best channel ever!
Thank you brother for all of your work.
your videos are so so good. thanks for your help
Informative video!
You are real bro, thanks for the helpful video again ;)
Smashed subscribed button Bro!! liked your way of teaching and accent. :)
bros for life and thanks for the playlist
Thank you so much bro very nice 😊❤
Thank you brother thank you if you need money allah give U A Billuner .!!!
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 ?
Your voice sounds exactly like Technoblade! : )
Thank you!!! now it makes sense.
Great tutorial bro
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!
Amazing! Thanks Bro
I noticed you deleted the char and string topic in the playlist?
Thanks for your tutorial.
Thank you for this !
thanks bro helped a lot
@BroCodez is it wrong to write
The value before the variable in the if statement for example
If( 20>iage)
Coming from knowing java script I now know they both have java in the name. Even for loops work the same.
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");
}
}
}
thx you helped so muchh😀
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!");
}
}
}
Thank you again 💙💙
Great video
Professor Bro Code to the rescue
Awesome Sauce!
amazing job, bro!
i cant seem to run it, the last "}" says "Syntax error , insert "}" to complete Classbody"
Thank you👍
Hello! What website/app are you using for coding?
As an eclipse user, how is your screen black? is it dark mode?
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?
Is it possible to join both if statement and switch case?
Thank you!
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"
I like your video
you are amazing!
thank bro very much
Like your didactics
Programmer: "int age;"
Me, a intergalactic eldritch monstrosity who just turned 2,147,483,648 years old: 😢
I love u bro
thx 4 vid bro
Good video !!!!
Love you bro!
Thanks bro
God Bless you Bro + 6
The best!!
what if you have multiple if statements
Thank you Chad
One question: If your age is 19, You are a teenager or an adult?
Adult
thx! learnt
rewqatch
Rewatch
Thanks bro!
thank you bro
Thanks
Thank you
dropping a comment for the youtube algorhitm
Ακόμα ένα καλό video για τη γλώσσα Java.
what
Nice bro!
Thank you bro)
thanks!!
great video brother
what a chad🗿
amazing
Thank!
Thanks Bro, 05/31/2024
TY BRO
tks bro
I f I watch this video, I will learn how to deal with if. If not, than not. :)
thanks
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
Nice
okay bro
nice bro
ty bro
your jokes are funny
❤❤❤❤❤
hey bro!
yessa
❤❤❤
Nice.