Java Conditional Operator Tutorial #64

  Рет қаралды 52,089

Alex Lee

Alex Lee

Күн бұрын

$1,000 OFF ANY Springboard Tech Bootcamps with my code ALEXLEE. See if you qualify for the JOB GUARANTEE! 👉 bit.ly/3HX970h
The conditional or ternary operator in java lets you make an if-else statement on one line!
There are 3 parts to the conditional (ternary) operator in Java. The first part results in true or false, the middle is the value if it's true and the last is the value if it's false!
I hope you enjoyed this Java conditional (ternary) operator java tutorial!
Full Java Tutorial For Beginners Playlist: • Full Java Course by Al...
Free Tips: bit.ly/3U6HXcb
Disclosure: Springboard link provided is linked to my affiliate account & supports the channel.
Alex Lee

Пікірлер: 97
@alexlorenlee
@alexlorenlee 8 ай бұрын
If you’re new to programming but want a career in tech, I HIGHLY RECOMMEND applying to one of Springboard’s online coding bootcamps (use code ALEXLEE for $1,000 off): bit.ly/3HX970h
@djuka8121
@djuka8121 3 жыл бұрын
Damn that one liner is powerful
@AceofInfo
@AceofInfo 3 жыл бұрын
Oh never realized to use it like that.. :D you are a great guide to me .. Thanks man ..
@bewatter3014
@bewatter3014 3 жыл бұрын
hey ace of info... you were here way before me :D so i would appreciate if you could answer my question... i really like how alex is explaining... so i choose to follow his playlist and he did start all.. because he wanted to make sure there is a source that everybody can access to understand it... but now he advocates so much his course... so i am afraid that he maybe shift the important content to his website? is my hunge correct? or are the upcoming topics still fully understandable to learn java? i would like to buy his course but right now its a little though because of corona :D
@AceofInfo
@AceofInfo 3 жыл бұрын
@@bewatter3014 well If you are a beginner sometimes it may be little hard to understand him.. It totally depends on you.. But I can say from all the tutorials I have seen, (even from my own tutorial in my channel) his guide is better..
@Daresigmally
@Daresigmally 2 жыл бұрын
Man this guy is a blessing. Thank you for all the effort you put into these videos..
@sayitbarberry
@sayitbarberry 3 жыл бұрын
I was reading about these in a book and I wasn't understanding it at all! this makes so much more sense, thanks!
@emuelvassallo4010
@emuelvassallo4010 3 жыл бұрын
I haven't heared sbout these before. Thank you so much for the video!
@reewajadhikari6799
@reewajadhikari6799 3 жыл бұрын
thx notification bouta learn something now today now🔔🔔
@proalexv
@proalexv Жыл бұрын
Super clear, thank you so much! Very helpful.
@juanpablocuellar8506
@juanpablocuellar8506 3 жыл бұрын
Nice TUTORIAL!
@janjeromesoriano1182
@janjeromesoriano1182 2 жыл бұрын
Thank you! This is very helpful.
@jobbaffet372
@jobbaffet372 3 жыл бұрын
WELL EXPLAINED MAN
@cherrysann1130
@cherrysann1130 3 жыл бұрын
thanks for sharing knowledge
@thefarooqbrothers4118
@thefarooqbrothers4118 3 жыл бұрын
Thanks Alex, you're the best
@Theart486
@Theart486 Жыл бұрын
Dude you're amazing I literally thought some song is also playing from other window and i went through every window to check where that song is coming from lol
@gold4963
@gold4963 3 жыл бұрын
This is really cool! It can make code more concise!
@thecodingchannelph
@thecodingchannelph 2 жыл бұрын
true
@butemjbat-orshikh5365
@butemjbat-orshikh5365 3 жыл бұрын
thanks that was very helpful
@typical_pronoobs4553
@typical_pronoobs4553 3 жыл бұрын
Dear bro, You are explaining everything very well and I request you to do more java practicing projects as well as advance java concepts as Soon as you can...I'm waiting..!🤩😍 Thanks in advance....!
@matthew11092
@matthew11092 3 жыл бұрын
never used or knew this before !
@javacodingcommunity
@javacodingcommunity 3 жыл бұрын
Java really has some cool tricks, but sometimes it's also really complicated haha. Great vid, keep going.
@meshachspeedcuber1319
@meshachspeedcuber1319 3 жыл бұрын
Man you're awesome man 😍🙂😎😄
@deadpl55
@deadpl55 3 жыл бұрын
Awesome 🙌🏼
@aditi246
@aditi246 3 жыл бұрын
thanks buddy...respect from INDIA 🧡
@thecodingchannelph
@thecodingchannelph 2 жыл бұрын
love from the philippines
@namename8225
@namename8225 3 жыл бұрын
You are the best
@lady669
@lady669 2 жыл бұрын
Brilliant! 👏👏👏
@ahmedfawzy728
@ahmedfawzy728 3 жыл бұрын
thank you
@thecodingchannelph
@thecodingchannelph 2 жыл бұрын
hello bro
@fuzedcable5612
@fuzedcable5612 3 жыл бұрын
Yey new vid
@ilmerdonenero
@ilmerdonenero 2 жыл бұрын
thanks
@thevictor180
@thevictor180 3 жыл бұрын
Let's go, finished the basics 1! time to move on to basics 2
@divyanshusharma5614
@divyanshusharma5614 3 жыл бұрын
Love from INDIA
@thecodingchannelph
@thecodingchannelph 2 жыл бұрын
love from the philippines
@simsij
@simsij 2 жыл бұрын
Got an exam this morning, came over for some quick revision 👀😂
@Santhoshkumar-vh7rt
@Santhoshkumar-vh7rt 3 жыл бұрын
hey alex can u explain some sorting algorithms :) waiting...!
@grass-eatingsheepwhen7713
@grass-eatingsheepwhen7713 3 жыл бұрын
*yes*
@fuzedcable5612
@fuzedcable5612 3 жыл бұрын
Next video can u teach how to make a progress bar and make it load? Or maybe teach how to install window builder on eclipse. I already know how to get windows builder but many don’t.
@CollidaCube
@CollidaCube 3 жыл бұрын
this is a cool tutorial! i didnt even know that was a thing! Next episode, can you do a tutorial on GUI graphics and stuff? like, drawing lines and figures in a GUI?
@fuzedcable5612
@fuzedcable5612 3 жыл бұрын
U don’t know how to do that? It’s pretty easy: it’s pre programmed in the java swing librar
@CollidaCube
@CollidaCube 3 жыл бұрын
@@fuzedcable5612 i'd still appreciate a tutorial
@realoddsx7082
@realoddsx7082 3 жыл бұрын
@@CollidaCube make a class extends JLabel and override public void paintComponent(Graphics g). Add the label to frame and you can draw with the Graphics object
@javacodingcommunity
@javacodingcommunity 3 жыл бұрын
@@CollidaCube I have some GUI tutorials if you need help with that.
@thiagocabrera3424
@thiagocabrera3424 3 жыл бұрын
Alexxxx could you make a video teaching us how to do a lineal from minor to major sort to a multidimensional array??
@thecodingchannelph
@thecodingchannelph 2 жыл бұрын
hello
@boatmcgoat7741
@boatmcgoat7741 3 жыл бұрын
You should do JavaFX GUI instead of Swing.
@EpicphoneGamer
@EpicphoneGamer 2 жыл бұрын
Nice
@LordPunckyii
@LordPunckyii 3 жыл бұрын
"FartGenerator" ? :))))) great project :D
@viswaskrottapalli
@viswaskrottapalli 3 жыл бұрын
We had that in school
@msbnrajput2777
@msbnrajput2777 3 жыл бұрын
@Alex Lee, what does that 'a.equals' called and why u used it? Thanks for the good vedio!!!
@vidsworthwatch6396
@vidsworthwatch6396 3 жыл бұрын
Tnx so smoth as always can u do a simple calculator on java too i wanna get operator on numbers from keyboard not from button that i make in gui cant write the code for it tho ty again
@yorepi774
@yorepi774 3 жыл бұрын
Can you make a polymorphism video?
@alexlorenlee
@alexlorenlee 3 жыл бұрын
Sure :)
@rword6118
@rword6118 3 жыл бұрын
Make a Java employee payroll system guide!
@fortyarcade6578
@fortyarcade6578 Жыл бұрын
Thank you! I was watching a course on udemy and got stuck!
@jaya.1610
@jaya.1610 Жыл бұрын
hey alex whats the difference between the java course and your youtube tutorials?
@georgietrottier9312
@georgietrottier9312 3 жыл бұрын
this can’t be used for a nested if statement, right? it’s just for a single if else statement?
@twitch_thisismt1832
@twitch_thisismt1832 3 жыл бұрын
Teach us how to make a circle!!
@Beanyboi2913
@Beanyboi2913 3 жыл бұрын
"String method" a.equals Is this always used instead of == when using String variables??? *** first week learning from scratch any advice appreciated
@thecodingchannelph
@thecodingchannelph 2 жыл бұрын
yes we use .equals when we compare 2 strings, on the other hand, we use == operator when we are comparing integers
@reewajadhikari6799
@reewajadhikari6799 3 жыл бұрын
alex how many languages can u code on?
@CollidaCube
@CollidaCube 3 жыл бұрын
Hi!!!
@thecodingchannelph
@thecodingchannelph 2 жыл бұрын
hello
@praveenshenoy8064
@praveenshenoy8064 2 жыл бұрын
it is case sensitive?
@nSackStyles
@nSackStyles 3 жыл бұрын
Can we use println statements with ternary operator?
@thecodingchannelph
@thecodingchannelph 2 жыл бұрын
yes
@Ino_86
@Ino_86 3 жыл бұрын
is there a way to nest these or use them with elif?(else if) :D
@mouniroujri1
@mouniroujri1 3 жыл бұрын
Im looking for job as automation tester !! Any suggestion ?
@sirmohammed772
@sirmohammed772 3 жыл бұрын
could you please tell us how did learned java ??
@thecodingchannelph
@thecodingchannelph 2 жыл бұрын
keep on programming
@adolfjamesurian6510
@adolfjamesurian6510 3 жыл бұрын
Why not use if? Or when to use if statement and conditional statement
@MaximumJoy
@MaximumJoy 3 жыл бұрын
Is this also know as a ternary operator?
@shotx333
@shotx333 3 жыл бұрын
Cool, how often is the ternary operator used?
@thecodingchannelph
@thecodingchannelph 2 жыл бұрын
it depends on you, its a replacement of If...else
@white_music9442
@white_music9442 Жыл бұрын
yo men your cool😉😉
@alexandrutica6610
@alexandrutica6610 3 жыл бұрын
Can you make a game with JFrame?
@alexbilsland6482
@alexbilsland6482 3 жыл бұрын
Is it possible you make a game in java with graphics and please can you create a tutorial on it! Thanks
@thecodingchannelph
@thecodingchannelph 2 жыл бұрын
yes like 2D games
@bingsan99
@bingsan99 3 жыл бұрын
Is this possible with boolean? 🤔
@thecodingchannelph
@thecodingchannelph 2 жыл бұрын
yes
@arrzeyd915
@arrzeyd915 3 жыл бұрын
Can I know the song name of the intro?
@themodestai9603
@themodestai9603 3 жыл бұрын
For people: It's also called ternary operator.
@imstilllearning1899
@imstilllearning1899 3 жыл бұрын
I know how to code programs like tic tac toe, rock paper scissors and some basic programs, what should i learn next ?
@ariton2990
@ariton2990 3 жыл бұрын
if you like making games try to make a simple 2d game.
@pratishkedia2020
@pratishkedia2020 3 жыл бұрын
System.out.println("Alex lee is the best java learning teacher for easy concepts")
@erikgormann1929
@erikgormann1929 3 жыл бұрын
double subs = 188.000; // thousand double leftSubs = 12.000; //thousand public static void makeHimTwoHundredThousand (double subs, double leftSubs){ double twohundredThousand = subs + leftSubs; if ( double twohundredThousand < 200.000){ System.out.println("keep on making those videos Alex ! "); } else { System.out.println("YESSSSSS ALEX LEE REACHED 200 THOUSANDD"); } } public static void main ( String[] args){ makeHimTwoHundredThousand(); }
@nanashipersonne4151
@nanashipersonne4151 2 жыл бұрын
The music in the background while you're talking was distracting for me in the beginning, but fortunately it stopped soon.
@mannyokafor4609
@mannyokafor4609 3 жыл бұрын
I got a text from my crush, but this came up on my notifications. You know what I chose.
@merowareinstance
@merowareinstance 3 жыл бұрын
lolz
@thecodingchannelph
@thecodingchannelph 2 жыл бұрын
haha
@geethai3956
@geethai3956 3 жыл бұрын
Hellloo Alex
@francisenterina4097
@francisenterina4097 Жыл бұрын
u so handsome i dont know where to look 😮‍💨
@Lesyzero
@Lesyzero 25 күн бұрын
فهمت كل شي بالفديو الا انك حاط وجهك ?
Stack Java Tutorial #65
9:31
Alex Lee
Рет қаралды 169 М.
Abstract Class In Java Tutorial #79
8:55
Alex Lee
Рет қаралды 535 М.
THE POLICE TAKES ME! feat @PANDAGIRLOFFICIAL #shorts
00:31
PANDA BOI
Рет қаралды 18 МЛН
ОСКАР ИСПОРТИЛ ДЖОНИ ЖИЗНЬ 😢 @lenta_com
01:01
Каха ограбил банк
01:00
К-Media
Рет қаралды 11 МЛН
Learn Java in 14 Minutes (seriously)
14:00
Alex Lee
Рет қаралды 4,6 МЛН
What is the ternary operator ❓
4:41
Bro Code
Рет қаралды 17 М.
Access Modifiers Java Tutorial #82
11:27
Alex Lee
Рет қаралды 228 М.
Object-Oriented Programming Java Tutorial (Java OOP) #71
14:07
Getters and Setters Java Tutorial #84
14:12
Alex Lee
Рет қаралды 490 М.
Java if statements 🚧【6 minutes】
6:12
Bro Code
Рет қаралды 134 М.
Checked vs. Unchecked Exceptions in Java Tutorial - What's The Difference?
10:14
#14 Ternary Operator in Java
4:39
Telusko
Рет қаралды 113 М.