Java Conditional Operator Tutorial #64

Поділитися
Вставка
  • Опубліковано 1 чер 2024
  • $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

КОМЕНТАРІ • 96

  • @alexlorenlee
    @alexlorenlee  7 місяців тому +1

    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 роки тому +20

    Damn that one liner is powerful

  • @AceofInfo
    @AceofInfo 3 роки тому +22

    Oh never realized to use it like that.. :D you are a great guide to me .. Thanks man ..

    • @bewatter3014
      @bewatter3014 3 роки тому +1

      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 роки тому +5

    Man this guy is a blessing. Thank you for all the effort you put into these videos..

  • @sayitbarberry
    @sayitbarberry 3 роки тому +2

    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 роки тому +3

    I haven't heared sbout these before. Thank you so much for the video!

  • @reewajadhikari6799
    @reewajadhikari6799 3 роки тому +6

    thx notification bouta learn something now today now🔔🔔

  • @proalexv
    @proalexv Рік тому +1

    Super clear, thank you so much! Very helpful.

  • @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

  • @janjeromesoriano1182
    @janjeromesoriano1182 2 роки тому

    Thank you! This is very helpful.

  • @cherrysann1130
    @cherrysann1130 3 роки тому

    thanks for sharing knowledge

  • @javacodingcommunity
    @javacodingcommunity 3 роки тому

    Java really has some cool tricks, but sometimes it's also really complicated haha. Great vid, keep going.

  • @typical_pronoobs4553
    @typical_pronoobs4553 3 роки тому +2

    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....!

  • @juanpablocuellar8506
    @juanpablocuellar8506 3 роки тому

    Nice TUTORIAL!

  • @butemjbat-orshikh5365
    @butemjbat-orshikh5365 3 роки тому

    thanks that was very helpful

  • @thefarooqbrothers4118
    @thefarooqbrothers4118 3 роки тому

    Thanks Alex, you're the best

  • @jobbaffet372
    @jobbaffet372 3 роки тому

    WELL EXPLAINED MAN

  • @gold4963
    @gold4963 3 роки тому +2

    This is really cool! It can make code more concise!

  • @matthew11092
    @matthew11092 3 роки тому +3

    never used or knew this before !

  • @meshachspeedcuber1319
    @meshachspeedcuber1319 3 роки тому +1

    Man you're awesome man 😍🙂😎😄

  • @aditi246
    @aditi246 3 роки тому +1

    thanks buddy...respect from INDIA 🧡

  • @deadpl55
    @deadpl55 3 роки тому

    Awesome 🙌🏼

  • @msbnrajput2777
    @msbnrajput2777 3 роки тому

    @Alex Lee,
    what does that 'a.equals' called and why u used it?
    Thanks for the good vedio!!!

  • @lady669
    @lady669 2 роки тому

    Brilliant! 👏👏👏

  • @Santhoshkumar-vh7rt
    @Santhoshkumar-vh7rt 3 роки тому +1

    hey alex can u explain some sorting algorithms :) waiting...!

  • @jaya.1610
    @jaya.1610 Рік тому

    hey alex whats the difference between the java course and your youtube tutorials?

  • @namename8225
    @namename8225 3 роки тому +1

    You are the best

  • @divyanshusharma5614
    @divyanshusharma5614 3 роки тому +3

    Love from INDIA

  • @fuzedcable5612
    @fuzedcable5612 3 роки тому +1

    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 роки тому +2

    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.

  • @thevictor180
    @thevictor180 3 роки тому +1

    Let's go, finished the basics 1! time to move on to basics 2

  • @LordPunckyii
    @LordPunckyii 3 роки тому +8

    "FartGenerator" ? :))))) great project :D

  • @georgietrottier9312
    @georgietrottier9312 3 роки тому +1

    this can’t be used for a nested if statement, right?
    it’s just for a single if else statement?

  • @ahmedfawzy728
    @ahmedfawzy728 3 роки тому +1

    thank you

  • @thiagocabrera3424
    @thiagocabrera3424 3 роки тому +1

    Alexxxx could you make a video teaching us how to do a lineal from minor to major sort to a multidimensional array??

  • @ilmerdonenero
    @ilmerdonenero 2 роки тому

    thanks

  • @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

  • @simsij
    @simsij 2 роки тому

    Got an exam this morning, came over for some quick revision
    👀😂

  • @Beanyboi2913
    @Beanyboi2913 3 роки тому +2

    "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

  • @Ino_86
    @Ino_86 3 роки тому

    is there a way to nest these or use them with elif?(else if) :D

  • @EpicphoneGamer
    @EpicphoneGamer 2 роки тому

    Nice

  • @reewajadhikari6799
    @reewajadhikari6799 3 роки тому

    alex how many languages can u code on?

  • @mouniroujri1
    @mouniroujri1 3 роки тому

    Im looking for job as automation tester !! Any suggestion ?

  • @fuzedcable5612
    @fuzedcable5612 3 роки тому +1

    Yey new vid

  • @boatmcgoat7741
    @boatmcgoat7741 3 роки тому +1

    You should do JavaFX GUI instead of Swing.

  • @yorepi774
    @yorepi774 3 роки тому +3

    Can you make a polymorphism video?

  • @shotx333
    @shotx333 3 роки тому +1

    Cool, how often is the ternary operator used?

  • @praveenshenoy8064
    @praveenshenoy8064 2 роки тому

    it is case sensitive?

  • @fortyarcade6578
    @fortyarcade6578 Рік тому

    Thank you! I was watching a course on udemy and got stuck!

  • @MaximumJoy
    @MaximumJoy 3 роки тому

    Is this also know as a ternary operator?

  • @nSackStyles
    @nSackStyles 3 роки тому +1

    Can we use println statements with ternary operator?

  • @grass-eatingsheepwhen7713
    @grass-eatingsheepwhen7713 3 роки тому +1

    *yes*

  • @viswaskrottapalli
    @viswaskrottapalli 3 роки тому +1

    We had that in school

  • @sirmohammed772
    @sirmohammed772 3 роки тому +1

    could you please tell us how did learned java ??

  • @adolfjamesurian6510
    @adolfjamesurian6510 3 роки тому

    Why not use if? Or when to use if statement and conditional statement

  • @alexbilsland6482
    @alexbilsland6482 3 роки тому +1

    Is it possible you make a game in java with graphics and please can you create a tutorial on it!
    Thanks

  • @white_music9442
    @white_music9442 Рік тому +1

    yo men your cool😉😉

  • @arrzeyd915
    @arrzeyd915 3 роки тому

    Can I know the song name of the intro?

  • @rword6118
    @rword6118 3 роки тому

    Make a Java employee payroll system guide!

  • @CollidaCube
    @CollidaCube 3 роки тому +2

    Hi!!!

  • @bingsan99
    @bingsan99 3 роки тому +1

    Is this possible with boolean? 🤔

  • @twitch_thisismt1832
    @twitch_thisismt1832 3 роки тому

    Teach us how to make a circle!!

  • @alexandrutica6610
    @alexandrutica6610 3 роки тому

    Can you make a game with JFrame?

  • @themodestai9603
    @themodestai9603 3 роки тому +1

    For people: It's also called ternary operator.

  • @nanashipersonne4151
    @nanashipersonne4151 2 роки тому

    The music in the background while you're talking was distracting for me in the beginning, but fortunately it stopped soon.

  • @pratishkedia2020
    @pratishkedia2020 3 роки тому +1

    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();
      }

  • @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.

  • @mannyokafor4609
    @mannyokafor4609 3 роки тому +2

    I got a text from my crush, but this came up on my notifications.
    You know what I chose.

  • @geethai3956
    @geethai3956 3 роки тому

    Hellloo Alex

  • @francisenterina4097
    @francisenterina4097 Рік тому

    u so handsome i dont know where to look 😮‍💨