The Do While Loop in Java

แชร์
ฝัง
  • เผยแพร่เมื่อ 3 ก.พ. 2025

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

  • @elisamutiofficial2245
    @elisamutiofficial2245 ปีที่แล้ว +12

    Finally I got clear difference between do while and while loops. Thank you for your support to the entire world

    • @Anand-im
      @Anand-im 7 หลายเดือนก่อน

      appo poi umbu da punda

  • @mvs2620
    @mvs2620 4 ปีที่แล้ว +12

    Sirr...you are just amazing!!!!... U just cleared my every doubt...

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

    I had 2 do while loops in the same function and kept getting and exception thrown by the second loop. I was confused why the do in the second loop was executing when the logic in the second while was not met. When you explained do while runs once then checks logic, it was a revelation moment. Thank you for saving me from nullpointerexception hell!

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

    Great explanations. Straight to the point thank you

  • @Kim-gf9rr
    @Kim-gf9rr 11 หลายเดือนก่อน

    Ay man! I really appriciate your teaching videos. I just want to let u know that keep fighting and keep living. Dont give up! I hope God bless you.

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

    Really worth it!!. I will give your reference in my school assignments too 💜💜

  • @perigogaming7863
    @perigogaming7863 4 หลายเดือนก่อน +1

    i just love this man

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

    wow best and most clear explanation

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

    i luv ur videos so much!!! the exercises are so useful and ur teaching is to the point
    thank you sir!

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

    thank you so much bro, it was amazing, i appraciate you

  • @Grace-oh3rg
    @Grace-oh3rg 3 ปีที่แล้ว +2

    wow awesome I really understand everything ! I have an exam on Friday so I will certainly be able to understand the question and do the task on compiler

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

      i guess Im randomly asking but does someone know of a way to log back into an instagram account?
      I was stupid lost my account password. I appreciate any assistance you can give me

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

      @Bryce Reece instablaster =)

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

      @Duncan Beckham I really appreciate your reply. I got to the site thru google and I'm trying it out atm.
      I see it takes a while so I will get back to you later with my results.

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

      @Duncan Beckham It did the trick and I now got access to my account again. Im so happy!
      Thanks so much, you saved my ass!

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

      @Bryce Reece happy to help =)

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

    You got a new subscriber, thank you

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

    Great tutorial ever👍

  • @ௐ_Sri_Murugar_Saranam
    @ௐ_Sri_Murugar_Saranam ปีที่แล้ว

    Excellent ...Thanks for you videos..

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

    thank you very much...
    please upload videos fast..
    when neso is going to start ds and algorithms

  • @ArthurAraujo-oo2ll
    @ArthurAraujo-oo2ll 2 ปีที่แล้ว

    A nice explanation! ty so much

  • @ashleyduffy2088
    @ashleyduffy2088 4 ปีที่แล้ว +8

    This was helpful in learning loops but everywhere I go, people use INT. most of my assignments want Strings.

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

    Would you be able to do an example of do-while loop but instead of integer to terminate the program we use a string to stop the program? e.g. while(i == "stop")

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

    Thank you so much sir keep it up please upload videos the descrite mathematics full course

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

    excellent explanation.... thanks.

  • @Ryan-le2im
    @Ryan-le2im 4 ปีที่แล้ว

    Awesome vid!

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

    That was amazing thank you

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

    sir i am a lot of learn from you .

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

    import java.util.Scanner;
    public class Main {
    public static void main(String[] args) {
    Scanner s = new Scanner(System.in);
    System.out.print("please enter a value between 1 and 10: ");
    long i = s.nextInt();
    do {
    System.out.print(i + " is wrong please try again: ");
    i = s.nextInt();
    } while (i > 10 || i < 1);
    System.out.println(i + " is correct");
    }
    }
    here's mine, a bit different but works the same ^^.

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

    Thanksssssss

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

    package ayushi;
    import java.util.Scanner;
    public class Main {
    public static void main(String[] arg) {
    Scanner intput = new Scanner(System.in);
    System.out.println("enter your number:");
    int a =intput.nextInt();
    do{
    System.out.println(a + "is in not between 1 and 10");
    a =intput.nextInt();
    }while (1>a || a>10) ;
    System.out.println(a + "is in between 1 and 10");
    }
    }

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

    what ide do you use?

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

      Intellij idea

  • @mraadi6258
    @mraadi6258 4 ปีที่แล้ว

    WHAT IS THE SYNTAX?

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

    Great

  • @jeyamuthu-eo6by
    @jeyamuthu-eo6by 3 ปีที่แล้ว

    supe explaination

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

    good video , oRayt?

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

    import java.util.Scanner;
    public class a{
    public static void main(String[]args){

    Scanner n=new Scanner(System.in);

    int input;
    do
    {
    System.out.print("Enter number between 1 and 10 :");
    input=n.nextInt();
    if(input>1&&input1&&input

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

    Sir what if we enter our first number in between 1 and 10
    Our program will ask us again to enter a number
    So we can use if else statements to solve this one
    In if block write condition as usual
    In else write do while
    It gives us effective output

    • @a.human.
      @a.human. 3 ปีที่แล้ว +2

      I just wrote the same program as the tutor in the vid, and entered a number between 1 and 10 in the first go. It didn't ask us "again" to enter a number. Better not to use if / else in this program, as who know in which go will the user enter the right number

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

      @@a.human. Using if and else blocks increases the efficiency of program and helps to solve many test cases

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

      @@jayanth5032 i believe we can it is more efficient to use it in while loop

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

      hey, i know it's a pretty late reply, but still I wanna say this: if we enter 1st number between 1 and 10, it will not ask for input again cause if the first input is within the range then it will not go into the while loop, it will straight come out of the loop and will print

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

    👍👍

  • @Jeremy-m8r
    @Jeremy-m8r ปีที่แล้ว

    Okau HABIBI

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

    I cant see the difference its the same

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

      basically the code runs at least once with do while loop. even if condition is false
      in a regular while loop if the condition is false the code never runs

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

    nice video but accent was lit

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

    can you talk little bet slower plz