Java logical operators ❗ (AND OR NOT)

แชร์
ฝัง
  • เผยแพร่เมื่อ 7 ก.ย. 2024
  • Java logical operators AND OR NOT
    #Java #logical #operators

ความคิดเห็น • 122

  • @BroCodez
    @BroCodez  3 ปีที่แล้ว +50

    public class Main {
    public static void main(String[] args) {

    // logical operators = used to connect two or more expressions
    //
    // && = (AND) both conditions must be true
    // || = (OR) either condition must be true
    // ! = (NOT) reverses boolean value of condition
    // -------------------------------- Example 1 --------------------------------
    /*
    int temp = 15;

    if(temp>30) {
    System.out.println("It is hot outside");
    }
    else if(temp>=20 && temp

    • @danielmilewski7659
      @danielmilewski7659 2 ปีที่แล้ว +2

      this is code for operators not switch!

    • @Simis999
      @Simis999 2 ปีที่แล้ว +3

      @@danielmilewski7659 bro this video is for operators not switch!

    • @user-ud6bi6nv6d
      @user-ud6bi6nv6d ปีที่แล้ว +2

      gotta save timeee

    • @itsokay7779
      @itsokay7779 3 หลายเดือนก่อน

      bro bro bro... May god bless you and your whole family

    • @violence101
      @violence101 3 หลายเดือนก่อน

      OMG I can't believe that there's a brilliant guy teaching java in easiest way, only you are the guy on yt who is teaching in the simplest way Java unbelievable THANK YOU SO MUCH SIR KEEP ON GOING❤️❤️👌

  • @emilakhmedov2553
    @emilakhmedov2553 2 ปีที่แล้ว +17

    May God bless you and your family.

  • @gamalieltun7038
    @gamalieltun7038 3 ปีที่แล้ว +5

    Your videos are so helpful for me. Watching them are like doing revision. Yeah..! It's so helpful.

    • @BroCodez
      @BroCodez  3 ปีที่แล้ว +5

      Thanks for watching Gamaliel!

    • @renanmarkpalaran9646
      @renanmarkpalaran9646 6 หลายเดือนก่อน

      So to I, thanks bro code. you have been such a great teacher.

  • @MuhammadAsif-zr6lk
    @MuhammadAsif-zr6lk 3 ปีที่แล้ว +2

    Thanks for sharing you simplified it and explained it really well👍

  • @kiwifpv5865
    @kiwifpv5865 3 ปีที่แล้ว +11

    Great series so far (the java tutorials) - very helpful teaching an old dog new tricks..;). especially love the fact that you use metrics rather than imperials..:)

  • @dianamilenaarchilacordoba4632
    @dianamilenaarchilacordoba4632 11 วันที่ผ่านมา

    great video!!! I'm infinitely grateful for your dedication and big heart to share this knowledge with the world. Thank you soo much ♥♥♥♥♥♥

  • @ruinasxp
    @ruinasxp 8 หลายเดือนก่อน +1

    You explain much better than my teacher 😀😀

  • @pavelkvasnicka6856
    @pavelkvasnicka6856 ปีที่แล้ว

    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

  • @Dev-PauloEd
    @Dev-PauloEd 2 ปีที่แล้ว +3

    Man, this is so cool. imagine what we can do with this

  • @CyberEscuela
    @CyberEscuela 19 วันที่ผ่านมา

    Awesome

  • @akbaralinabiev
    @akbaralinabiev ปีที่แล้ว

    Very easy to understand, appreciate BRO

  • @BarryAllen-fj9nb
    @BarryAllen-fj9nb 6 หลายเดือนก่อน

    this is really helpful like a lot

  • @JuliHoffman
    @JuliHoffman 2 ปีที่แล้ว

    Wish I'd seen this video 2 weeks ago! Thanks again.

  • @broboowo
    @broboowo 9 หลายเดือนก่อน

    Godbles for you bro. And l subscribe you channel 😊 , l'm personaly thank you soo much 🙏🏽🙏🏽🙏🏽

  • @alexreznitsky6338
    @alexreznitsky6338 ปีที่แล้ว

    😎 great videos, thanks

  • @stargazer6584
    @stargazer6584 ปีที่แล้ว

    Great tutorial as always

  • @Minecarthus
    @Minecarthus 3 ปีที่แล้ว

    Your videos are so helpful thank you so much !!!

  • @Garrison86
    @Garrison86 2 ปีที่แล้ว

    Awesome 👌 thanks Bro

  • @sillyquestions4709
    @sillyquestions4709 2 ปีที่แล้ว +1

    Scanner scanner = new Scanner(System.in);

    System.out.println("You are playing a game! Press q or Q to quit");
    String response = scanner.next();

    Just wanted to know, in this line why did u not use scanner.nextline( )?
    Thank you so much for your making these videos. They are extremely helpful.

    • @bryanZ17
      @bryanZ17 2 ปีที่แล้ว +2

      You probably already know the answer but... since he's only entering one character (like q or Q) and not a full word, he can just use .next() which checks only for the first character that the user enters and not then remaining characters.

  • @Simis999
    @Simis999 2 ปีที่แล้ว +1

    You sound like a fast bro on 2x speed, especially when I'm drinking wine

  • @daniels.2876
    @daniels.2876 3 ปีที่แล้ว +1

    Amazing tutorials! Thx dude!

  • @Chryzsean420
    @Chryzsean420 2 ปีที่แล้ว

    Still watching the series! thank you bro!

  • @azamato
    @azamato 2 ปีที่แล้ว

    Thanks for video!

  • @zenonangelobarut7725
    @zenonangelobarut7725 7 หลายเดือนก่อน

    hello bro hope you will read this. I can only use sysout ctrl + space once and if I do it again then you must click it before the IDE corrects it. How to fix that? btw im using 2023 version of eclipse

  • @ArrowLord
    @ArrowLord 3 ปีที่แล้ว

    i saw a course for 10$ in udemy but urs was free and very much helpful

    • @rupamdey5411
      @rupamdey5411 3 ปีที่แล้ว +1

      Shift+\\

    • @ArrowLord
      @ArrowLord 3 ปีที่แล้ว +1

      @@rupamdey5411 hmmm?

  • @ghoggaliabdou4222
    @ghoggaliabdou4222 3 ปีที่แล้ว +3

    Thank you again 💙💙💙💙💙

  • @greeneggsandmushrooms9855
    @greeneggsandmushrooms9855 3 ปีที่แล้ว +1

    if only every argument involved logic

  • @hoanginh1437
    @hoanginh1437 2 หลายเดือนก่อน

    can someone explain for me the different between the scanner.Next() and scanner.NextLine() pls

  • @aditipatil3807
    @aditipatil3807 ปีที่แล้ว

    Thanks

  • @TamLe-ys7ck
    @TamLe-ys7ck 2 ปีที่แล้ว +2

    In Example 2, should I use this?
    if(response == "q" || response == "Q") {
    System.out.println("You quit the game");
    }
    else {
    System.out.println("You are still playing the game *pew pew*");
    }

    • @sairos4057
      @sairos4057 2 ปีที่แล้ว +2

      I tested here and it didn't work. I think it'd work in another programming language but not Java

    • @shellby4911
      @shellby4911 2 ปีที่แล้ว

      @@sairos4057 to work just change the first line , will be like this:
      if((response == "q") || (response == "Q")) {
      System.out.println("You quit the game");
      }

  • @ThomasTheThermonuclearBomb
    @ThomasTheThermonuclearBomb 2 ปีที่แล้ว

    Great video!

  • @user-mc9uv7ij7x
    @user-mc9uv7ij7x ปีที่แล้ว

    ❤❤❤

  • @Giovanni-Rhonim
    @Giovanni-Rhonim 7 หลายเดือนก่อน

    Gos bless you Bro +9

  • @soumelee5661
    @soumelee5661 ปีที่แล้ว

    cool game...

  • @marcelogodinho8751
    @marcelogodinho8751 ปีที่แล้ว

    This one gave me a hard time when trying to do it with a GUI... and I gave chatgpt a hard time trying to explain to me what why it wasn't working lol

  • @javierpesaresi311
    @javierpesaresi311 ปีที่แล้ว

  • @darksev.6468
    @darksev.6468 5 หลายเดือนก่อน

    Why would you use these instead of switches?

  • @huuloc8719
    @huuloc8719 2 ปีที่แล้ว

    Nice.

  • @bekturasanbekov1979
    @bekturasanbekov1979 ปีที่แล้ว

    thx 4 vid bro !

  • @phiphongnguyen3352
    @phiphongnguyen3352 2 ปีที่แล้ว +1

    thanks you boss

  • @HoonV9
    @HoonV9 5 หลายเดือนก่อน

    how"d you do the shortcut of that import?

  • @vough9542
    @vough9542 5 หลายเดือนก่อน

    I made a scanner method(?) How can I repeat it so I dont have to run the program every time?

    • @Ctrl-Z-Renders
      @Ctrl-Z-Renders 3 หลายเดือนก่อน

      While or for loop! (he made tutorial for those too)

  • @baubaudinamo
    @baubaudinamo 3 ปีที่แล้ว

    good job

  • @shiwari1280
    @shiwari1280 3 ปีที่แล้ว

    Nice video

  • @erniewhite7875
    @erniewhite7875 ปีที่แล้ว

    Love you videos

  • @williamtowne2079
    @williamtowne2079 2 ปีที่แล้ว

    thank u

  • @wallstreetbets7741
    @wallstreetbets7741 2 ปีที่แล้ว

    learnt

  • @danny.3036
    @danny.3036 3 ปีที่แล้ว +1

    Thanks, Bro!

  • @omersond4891
    @omersond4891 3 ปีที่แล้ว

    thats gooood

  • @BISAMARKSMANDOANG
    @BISAMARKSMANDOANG ปีที่แล้ว

    gg

  • @iampresent8062
    @iampresent8062 2 ปีที่แล้ว +1

    3:43 how did you do that bro?

  • @matinmonshizadeh
    @matinmonshizadeh 2 ปีที่แล้ว

    thanks bro

  • @grozageorge2887
    @grozageorge2887 ปีที่แล้ว

    🙂

  • @JustNeutral14.
    @JustNeutral14. หลายเดือนก่อน

    lets go after a small break im back doing these :)

  • @ibrahimylmaz8378
    @ibrahimylmaz8378 2 ปีที่แล้ว

    you are amazing!

  • @simik4830
    @simik4830 24 วันที่ผ่านมา

    comment for algorithm!

  • @bartomiejsniadach5795
    @bartomiejsniadach5795 2 ปีที่แล้ว

    Thank you

  • @equaliser19
    @equaliser19 3 ปีที่แล้ว

    thanx bro

  • @trickysachin
    @trickysachin 2 ปีที่แล้ว

    Bro 🤜

  • @curious6678
    @curious6678 4 หลายเดือนก่อน

    why did we use next and not nextLine

  • @adityaalshi7081
    @adityaalshi7081 2 ปีที่แล้ว

    ❤️❤️🙌🙌

  • @absinteta6610
    @absinteta6610 ปีที่แล้ว

    :)

  • @gamingwithjeevu7069
    @gamingwithjeevu7069 ปีที่แล้ว

    Thank you!

  • @octavianalin9502
    @octavianalin9502 3 ปีที่แล้ว

    Thanks!

  • @chi4600
    @chi4600 11 หลายเดือนก่อน

    thank you so much!

  • @sairos4057
    @sairos4057 2 ปีที่แล้ว

    TY bro

  • @martinsvanda5874
    @martinsvanda5874 ปีที่แล้ว

    work

  • @Hades2005-m2r
    @Hades2005-m2r 2 ปีที่แล้ว

    Thanks Bro !

  • @Gametimewithsurya
    @Gametimewithsurya หลายเดือนก่อน

    Bro is bro

  • @twilightstruggle8390
    @twilightstruggle8390 ปีที่แล้ว

    GOAT!

  • @liquidice2783
    @liquidice2783 3 ปีที่แล้ว

    I cant find the symbol for the OR logical operator on my keyboard

  • @alialhussain4139
    @alialhussain4139 3 หลายเดือนก่อน

    Thanks, Bro 06/01/2024

  • @Horatius_23
    @Horatius_23 ปีที่แล้ว

    Thanks! :D

  • @trypwyre9024
    @trypwyre9024 2 ปีที่แล้ว

    Bro, pizza day exists! Feb 9!

  • @sibambozodwa2290
    @sibambozodwa2290 ปีที่แล้ว

    thank you❤❤

  • @kirillutsenko9306
    @kirillutsenko9306 2 ปีที่แล้ว

    thx bro!

  • @paugalerafuentes8618
    @paugalerafuentes8618 2 ปีที่แล้ว

    6:03

  • @danielmilewski7659
    @danielmilewski7659 2 ปีที่แล้ว

    comment for stats!

  • @jarza4
    @jarza4 ปีที่แล้ว

    ankaraaa ankaraaaaasa

  • @Dev-PauloEd
    @Dev-PauloEd 2 ปีที่แล้ว

    i am the liker number 667

  • @cesara9747
    @cesara9747 2 ปีที่แล้ว

    smooth and easy!

  • @711mobiles
    @711mobiles 3 ปีที่แล้ว

    temp in And Or Not moving to next lesson

  • @queena594
    @queena594 3 ปีที่แล้ว +1

    "

  • @AARTIKUMARI-fe8wx
    @AARTIKUMARI-fe8wx ปีที่แล้ว

    vedio - 11

  • @chrish.44
    @chrish.44 ปีที่แล้ว

    You are an insane teacher

  • @99Hitsugaya
    @99Hitsugaya 3 ปีที่แล้ว

    bro

  • @lukedecum
    @lukedecum ปีที่แล้ว

    !sis

  • @trickysachin
    @trickysachin 2 ปีที่แล้ว

    Bro 🤜 code

  • @maciejkaminski8535
    @maciejkaminski8535 3 ปีที่แล้ว

    comment

  • @patrickpasaje4037
    @patrickpasaje4037 3 ปีที่แล้ว

    "Video 11"

  • @terrathefifth
    @terrathefifth ปีที่แล้ว

    Comment 11

  • @retroartist9186
    @retroartist9186 3 ปีที่แล้ว

    .

  • @Klevesjokk
    @Klevesjokk 3 ปีที่แล้ว

    dab

  • @nikitassouvatzis1928
    @nikitassouvatzis1928 ปีที่แล้ว

    Ακόμα ένα πολύ ενδιαφέρον video της σειράς μαθημάτων για τη Java.

  • @yeliza2350
    @yeliza2350 2 ปีที่แล้ว

    6 february l m done thenk you bro kod

  • @alexyakoveno4682
    @alexyakoveno4682 2 ปีที่แล้ว

  • @PoorwayTraning
    @PoorwayTraning ปีที่แล้ว

    can i use this ?
    if ((response == "q") || (response =="Q")){
    System.out.println("You quit a game");
    }
    else{
    System.out.println("You are still playing the game *pew pew*");
    }

  • @MrLoser-ks2xn
    @MrLoser-ks2xn 2 ปีที่แล้ว

    Thanks

  • @buddhimakaushalya2912
    @buddhimakaushalya2912 2 ปีที่แล้ว

    gg

  • @BitchAssYaoi
    @BitchAssYaoi 11 หลายเดือนก่อน

    thank you