Nested if-else Statements in Java

Поділитися
Вставка
  • Опубліковано 5 лис 2024

КОМЕНТАРІ • 25

  • @23wintermute
    @23wintermute 9 місяців тому +8

    STUDENTS BEWARE: This assessment of the code is incorrect. Java ignores whitespace, so there is no nesting here, it's simply a regular IF/ELSE IF/IF statement. This is a great example of why best practice is to use brackets with your conditional statements. It's also a good example of why certain languages use "elif" instead of "else if" - Python does this, for example. In your case, the logic would work the same even if you added brackets after the first else, but this is not always the case. I'd give you an example, but this is meant as a short comment.

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

    Thanks so much, man! I only watched the first 44 secs to get what I'm looking for. Appreciate it!

  • @QueenChisomoSosola-zk9yh
    @QueenChisomoSosola-zk9yh 6 місяців тому +1

    Am here in 2024, thank you for making my java journey abit easier 😊

    • @Kamal17824
      @Kamal17824 15 днів тому

      how's your java journey going so far?

  • @rajeevverma7435
    @rajeevverma7435 4 роки тому

    Thanks a lot from India

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

    Thanks for sharing. Very explanatory.

  • @shivangi2174
    @shivangi2174 4 роки тому +4

    Awesome video Sir

  • @mahmmadhusen6794
    @mahmmadhusen6794 4 роки тому +1

    Exillient method of teaching..

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

    good explanation man

  • @admajid2905
    @admajid2905 4 роки тому

    Sir g opp kb kerwayn gy

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

    Thanks neso academy

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

    i can already tell your Lebanese from the accent, but thanks a lot mate.

  • @venkataswamykadiyam977
    @venkataswamykadiyam977 4 роки тому

    If I want total all videos of java what can I do sir???How can I get all videos????

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

      Tel laga aur ulta let jaa

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

      @@ArenDeager tune bhi yhi kia tha 😂😂😂

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

      @@ArenDeager tu ja jake anime dekh. Vo hi kr skta h

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

    done

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

    thank you sir

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

    When you say it saves time does it mean the time for compilation? 🤨

  • @trummler4100
    @trummler4100 Місяць тому

    Shikanoko Nokonoko greaterThanTen

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

    they like using simple stuff

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

    import java.util.Scanner;
    public class codechef{
    public static void main(String args[]){
    Scanner oii = new Scanner(System.in);
    int n = oii.nextInt();
    if(n>10){
    System.out.println("n is greater than 10");
    }
    else if(n==10){
    System.out.println("n is equal to 10");
    }
    else{
    System.out.println("n is less than 10");
    }
    }
    }