Learn for and while Loops in Java - Core Java - Part -3

Поделиться
HTML-код
  • Опубликовано: 8 сен 2024
  • JavaBasics part 3: Loops Concept and Increment Decrement Operators in Java
    Learn:
    for loop programs in java with output
    java while loop example
    enhanced for loop in java example
    nested for loop in java
    java for loop array
    java for each loop
    java for loop iterator
    java for loop list
    ===================================
    ubscribe to this channel, and press bell icon to get some interesting videos on Selenium and Automation:
    www.youtube.co...
    Follow me on my Facebook Page:
    / naveenqtpexpert
    ~-~~-~~~-~~-~
    Follow my Site/Blog: www.naveenautom...
    ========================================================
    Please watch: "Selenium & Automation Interview Preparation - By Naveen AutomationLabs"
    • Selenium & Automation ...
    ~-~~-~~~-~~-~ Subscribe to this channel, and press bell icon to get some interesting videos on Selenium and Automation:
    www.youtube.co...
    Follow me on my Facebook Page:
    / naveenqtpexpert
    Let's join our Automation community for some amazing knowledge sharing and group discussion on Telegram:
    t.me/joinchat/...
    Paid courses (Recorded) videos:
    Java & Selenium Course: www.naveenautom...
    API Course: www.naveenautom... ➡️Get Our Courses✔️
    📗 Get My Paid Courses at
    Paid courses (Recorded) videos:
    Java & Selenium Course: www.naveenautom...
    API Course: www.naveenautom...
    -------------------------------
    ✔️SOCIAL NETWORKS
    Facebook: / naveenqtpexpert
    Twitter: / naveenkhunteta
    Blog: www.naveenautom...
    --------------------------------
    Support My Channel✔️Or Buy Me A Coffee
    Paypal: paypal.me/nave...
    Google Pay: naveenanimation20@gmail.com
    --------------------------------
    ✔️Thanks for watching!
    देखने के लिए धन्यवाद
    Благодаря за гледането
    感谢您观看
    Merci d'avoir regardé
    Grazie per la visione
    Gracias por ver
    شكرا للمشاهدة

Комментарии • 38

  • @lathallakshmi9562
    @lathallakshmi9562 4 года назад +2

    amazing ... i have seen and even learnt by paying but no one explained so far like this ...Thnaks much

  • @ashwinib5017
    @ashwinib5017 3 года назад +4

    Thank you for explaining post /pre increment and decrement...was not aware

  • @vrushalikangare7432
    @vrushalikangare7432 9 месяцев назад +1

    Wow really love the way of teaching thank you so much😊

  • @WhiteKnight_OG
    @WhiteKnight_OG 5 месяцев назад

    Thank you so much sir perfect session

  • @snehabiradar4386
    @snehabiradar4386 2 года назад +1

    Thanku so much........ Amazing teaching skills 🥰

  • @vinoddhale2428
    @vinoddhale2428 2 года назад

    Thanks sir for sharing this video.... really appreciate your support

  • @luckylily9561
    @luckylily9561 5 лет назад +5

    I became big fan of u sir😘😍

  • @WMohanty
    @WMohanty 4 года назад +1

    Awesome Explanation Naveen. God Bless you for guiding us.

  • @raashidhabarakath1702
    @raashidhabarakath1702 4 года назад

    Wow , Thanks alot. The way you teach is amazing

  • @sivachandiranv2261
    @sivachandiranv2261 4 года назад

    Satisfied n understood..🙌🏻✌🏻

  • @abrarazeez1692
    @abrarazeez1692 5 лет назад +4

    Sir can you please add Pattern programs tutorials using Forloop?

  • @arabindamohanty2190
    @arabindamohanty2190 5 лет назад +1

    Great

  • @posanipavankumar8946
    @posanipavankumar8946 4 года назад +1

    Can some one clarify this doubt?
    In this video its mentioned that while loop has an disadvantage. If you don't give increment/decrement part then it will generate infinite loop. But the same logic is applicable to for loop as well.Compiler doesn't throw any error even if you don't provide increment/decrement part in for loop also. So why is this is not a disadvantage in for loop?

    • @kvrkvr486
      @kvrkvr486 3 года назад

      Exactly, my doubt is the same as well..

    • @revanappanawade3684
      @revanappanawade3684 11 месяцев назад

      Because the the syntax of while loop is "while(condition)" the increment or decrement part is optional but in for loop the syntax is "for(initialization; condition; increment/decrement)" thats why it does not give infinite loop

  • @harshakalal529
    @harshakalal529 2 года назад

    Hey Naveen... It would be great if you teach how to use do while loop and switch case in java.

  • @user-tb6vy9rk2l
    @user-tb6vy9rk2l 6 месяцев назад

    what if we do not give incremental or decremental in For loop? in while loop if we do not do the above, the the output would go infinite.. So, what happens in For loop for the same scenario

  • @supriyapawar8417
    @supriyapawar8417 4 года назад

    Thank you Naveen

  • @pankajkashyap8521
    @pankajkashyap8521 2 года назад

    QUERY:
    for(int j=1; j

  • @snehaingalkar491
    @snehaingalkar491 3 года назад

    very nicely explained

  • @arifsiddiq1826
    @arifsiddiq1826 3 года назад +1

    Hi Naveen sir..thanks so much for your videos. one question regarding For loop, As I have seen that the same behavior appears for "For" loop as well if we doesn't use increamental /Decremental than what's the main difference between While and For loop.
    }

    • @RohitKumar-gr9jb
      @RohitKumar-gr9jb 3 года назад

      The 'for' loop used only when we already knew the number of iterations. The 'while' loop used only when the number of iteration are not exactly known. If the condition is not put up in 'for' loop, then loop iterates infinite times. If the condition is not put up in 'while' loop, it provides compilation error.

    • @kvrkvr486
      @kvrkvr486 3 года назад +1

      @@RohitKumar-gr9jb bro, what if we do not give incremental or decremental in For loop? As Naveen mentioned, in while loop if we do not do the above, the the output would go infinite.. So, what happens in For loop for the same scenario as in while loop

  • @bhaskarvardhamana836
    @bhaskarvardhamana836 2 года назад

    nice

  • @lucylucy8517
    @lucylucy8517 4 года назад

    Tqu sir

  • @priyat6051
    @priyat6051 5 лет назад

    Thanks alot

  • @deepanshumehta9595
    @deepanshumehta9595 3 года назад

    Thanks Naveen, Isn't * a special character ? If yes, why we didn't use single quotes for *********

    • @starblack7680
      @starblack7680 2 года назад

      It can be used for single char only once digit

  • @RajuDas-zn3gx
    @RajuDas-zn3gx 6 лет назад +1

    When i try i=i+1 to goes to infinite loop. Is i++ and i=i+1 not same?

    • @arabindamohanty2190
      @arabindamohanty2190 5 лет назад +1

      But for me when I try I++ it's infinitive and for i=I+1 ok

  • @srinath6088
    @srinath6088 6 лет назад

    how i will get source code from oops concept videos..

  • @havesomefun4394
    @havesomefun4394 4 года назад

    I can't understand stand in pre increments and post can u elaborate it pls

    • @rvdjc
      @rvdjc 4 года назад +10

      Consider the same example from the tutorial:
      int i=1
      int j=i++(i++ is similar to i=i+1)
      int j=i=i+1(I wrote i++ as i=i+1)
      The above statement will be executed as
      j = i and i = i+1
      Hence output of j will be 1 and output of i will be 2(As mentioned in the tutorial, always the value of a variable will get updated with the new assigned value, hence value of i is 2 instead of 1).
      This is what i understood from the tutorial
      Hope this helps you

  • @SourabhPrajapatTheVlogger
    @SourabhPrajapatTheVlogger 3 года назад

    Why ur all class start with capital letter? its incorrect. right? it should start with small

    • @gendballa3676
      @gendballa3676 3 года назад +1

      What a gold question!! You are like Tare Zameen par!!!

    • @naveenautomationlabs
      @naveenautomationlabs  3 года назад +3

      Hi Sourabh, As per offcial oracle java documentation on Class Naming Convention: Class names should be nouns, in mixed case with the first letter of each internal word capitalized. Try to keep your class names simple and descriptive. Use whole words-avoid acronyms and abbreviations (unless the abbreviation is much more widely used than the long form, such as URL or HTML).
      Ex:
      class Raster;
      class ImageSprite;
      www.oracle.com/java/technologies/javase/codeconventions-namingconventions.html#:~:text=Class%20names%20should%20be%20nouns,such%20as%20URL%20or%20HTML).

    • @rahulraghuwanshi20
      @rahulraghuwanshi20 3 года назад

      @@naveenautomationlabs great sir .