For Each Loop In Java Tutorial #39

Поділитися
Вставка
  • Опубліковано 13 січ 2025

КОМЕНТАРІ • 130

  • @alexlorenlee
    @alexlorenlee  Рік тому +3

    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

  • @hanac5586
    @hanac5586 3 роки тому +33

    You're seriously one of the best teachers ever. You actually explain stuff thoroughly yet still simply and demonstrate it properly. Perfect. My professors should learn from you ;^)

  • @VivianHuangSnowy
    @VivianHuangSnowy 5 років тому +81

    This line by line explanation is bless

  • @dannehsg978
    @dannehsg978 5 років тому +65

    Alex I found out your channel almost 2 weeks ago and now I get thrilled to see your uploads plus I’m glad that you’ve gained 1k subs in just one week you’ll get that dream car soon

  • @marc4594
    @marc4594 4 роки тому +15

    Thanks man :).
    I am trying to get deep in java these days, and when um stuck, i look for you :)
    you simplify things in a very good way.
    Keep it up!!

  • @youareiamurim
    @youareiamurim 5 років тому +16

    I agree with Dannesh! 😊 Your videos are exellent in their short and informative format! Keep it going!! 👍

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

    Very useful video , thanks!

  • @Amera-vt6xo
    @Amera-vt6xo 4 роки тому +23

    "These are all cars i really want"
    He is cute

  • @Aditya-Pathariya
    @Aditya-Pathariya 4 роки тому +3

    Your tutorials are super simple and helpful Alex. I watch your tutorials now when I need help. Thank you.

  • @ahmedmustafa9154
    @ahmedmustafa9154 7 місяців тому

    Can't thank you enough! The thorough breakdown made all the difference in understanding this.

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

    Hey thanks man you really helped me out in my finals and also i hope you get your dream car:>

  • @Drdominguezc
    @Drdominguezc 2 роки тому +1

    You are amaizing, thank you!!!!!!

  • @dname1802
    @dname1802 3 місяці тому

    Line-by-line explanation really helps. Thank you!

  • @ernestocabrera6976
    @ernestocabrera6976 2 роки тому +2

    3 years later but thanks for the tutorial extremely helpful!
    Also, I just bought a 6-speed manual 2022 Veloster N, if you haven't pulled the trigger on any of the cars listed, the VN won't disappoint!
    Cheers, thanks again!

  • @omexiechama846
    @omexiechama846 4 роки тому +2

    this is an impressive channel, we are getting it loud and clear

  • @abdeselamselami4532
    @abdeselamselami4532 5 років тому +5

    Thanks a lot Alex, for everyone the short-cut of System.out.println() is type sysout + hit buttons ctrl+space.

  • @jeeteshkumar11
    @jeeteshkumar11 2 роки тому +4

    This is some premium content, appreciate your efforts Alex, keep it up.

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

    men, i only used to watch portuguese youtubers in programming cuz its my main language, and i have to say this is the best english speakin Java youtuber i've seen this far!Congrats

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

    So glad I'm growing in a time where Alex Lee finished his java instructionals 😭 actually the best tutor i've had

  • @minhhuynh2646
    @minhhuynh2646 5 років тому +6

    I learn a lot from your vids. Thank you

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

    This is the first video I watched from you. I hit subscribe and liked it halfway through the video because you explained every step of the way. As someone who has just started out, you teach better than my instructors at school.

  • @imaverygoodguy
    @imaverygoodguy 5 років тому +2

    You have the best java tutos on UA-cam 😃😃😍😍😍💪🏼🇩🇿

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

    Whenever my class explains something half ass or only just shows me something for the sake of learning something else I come here and it's all clear as day!

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

    You are very good teacher!!!

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

    Great video! I like the quick and fluent explanation, and especially how you go line by line. Thanks!

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

    Thanks for free tutorial 😍

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

    omg thank you so much i needed this

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

    I learned java like a year ago , almost forgot how to code, your video definitely helpful . I learned a lot from your video.

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

    Seriously helping me get through my java courses! Thank you!!!!

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

    WoW... I've struggled with this however I've just watched your vid... I think I finally have it down. Thank u.

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

    👏👏you are a great teacher. Well done

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

    finally this was the video i needed!!!!

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

    Alex you're a legend man

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

    Alex you're just a hero! Honestly dude you're doing such an amazing work. Rooting for you!

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

    thank you bro your video was easy to understand

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

      Int no[][] = {{1,2,3},{4,5,6},{7,8,9}};
      for (int j[] : no)
      {
      for(int k : j)
      {
      System.out.print(k);
      }
      }
      If you want more video with logic see my channel playlist

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

    nicely explained , really good and to the point .Thankyou Alex

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

    Love all your videos !! they are really a bless !!!

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

    THANKK YOUUU VERY MUCHHH, I have been working for this assignment for almost two nights and discovering the print and println difference

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

    this dude coming in clutch

  • @AK-iy9gl
    @AK-iy9gl 5 років тому +2

    Thanks for this Alex! Excellent vid. I thought I knew how it worked and to a certain extent I was right, but this really helped cement my understanding of it :D

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

    Now I got it! Thank you!!!

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

    You save me yet again! Thank you.

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

    Mahn I love how well you explain stuff that confuses me. Thank you for the line by line explanation. Bless up mahn!

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

    So helpful! Thanks a ton!

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

    Thank you as always

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

    Thank you! Your videos really help me with my studies!!! :)

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

    Thank you so much. I've been sat here scratching my head and you've helped me a lot! What keyboard do you use?

  • @Yazeed-898
    @Yazeed-898 4 роки тому

    Thank you so much my friend!!

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

    Holy moly u save me everytime before exams

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

    Simple and very easy to understand. Thanks Mr. Alex Lee. Fan from India. :)

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

    Thanks.. It will be helpful :)

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

    Thank you i learn so much here ^^

  • @aarona9469
    @aarona9469 5 років тому +1

    Amazing. Thank you

  • @passatpower3600
    @passatpower3600 2 роки тому +1

    How can you make the loop go multippel times or as many times you want?

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

    Thanks Alex!!

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

    Thanks a lot man!

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

    Yeah; thank you, it's very handy; and Also this is for nested loop:
    String[][] formlist = {{"Liam", "Olivia", "Emma" ,"Oliver" ,"Elijah"},{"Age", "Address", "lastName", "Password"}};
    for(String names: formlist[0]) {
    for(String columns: formlist[1])
    System.out.println(names + " , " + columns);
    }

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

    Thank you!

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

    Wtf.. just replacing a forLoop by forEachLoop solved the problem ive been stuck on for hrs. Thanks a lot Alex!

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

    Thank you very much

  • @ikramekettani8657
    @ikramekettani8657 5 років тому

    thank you very much for all the videos, keep it up ! I was wondering.. could you please do a video on JDBC?

  • @sime813
    @sime813 5 років тому +1

    You are far more better eloquent than my prof. Hahaha
    BTW thanks!

  • @smileyghostkat3068
    @smileyghostkat3068 7 місяців тому

    Thanks!

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

    Thank You

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

    if I search a programming subject, then Alex face shows up, that means im gonna have a great time understanding this subject

  • @MairegShewangizaw
    @MairegShewangizaw 3 дні тому

    U always do the one thing I wanna know

  • @JossinJax
    @JossinJax 5 років тому +1

    I apologize if you've already answered this, but why when you create a for each loop for your Arraylist of data type do you then use the primitive "int" to iterate through the Arraylist?

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

    Thank you

  • @it4773
    @it4773 4 роки тому +2

    Bro love form INDIA to you and your faimly

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

    thanks for explainig bro i always use to see this in various code but never got what it actually is ...
    Thanks!!!!!!!!!!!!!!!!

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

    Best explanation

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

    All the way from middle east.. Thanks youre the best

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

    thankuuuuu 💜💜💜

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

    SO GOOD!

  • @imanuelh.399
    @imanuelh.399 5 років тому

    Nice Tutorial Alex! Could you please explain UnitTest?

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

    may i know what song did u use a the start of the vid 😁

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

    0 dislikes, the first in UA-cam history

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

    3:15 For each loop

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

    much thanks

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

    great technique.

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

    nice vid, thanks

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

    thank you buddy
    .

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

    Awesome dude you're amazing

  • @ВасилиянВасилев
    @ВасилиянВасилев 2 роки тому

    Thanks man :).

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

    Bro you are a goat ! tysm

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

    you make code so easy

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

    That’s pretty kewl

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

    Is this for each loop only good for printing the entire array? Or can you limit it like the other for loops involving i=0; I< length; etc

  • @sarthakkher
    @sarthakkher 5 років тому

    Could you do a video on heaps?

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

    I get most of it but is the 'String car' a completely new variable inside the for each loop? I see 'cars' in the String array declaration but no mention of a 'car' class or variable mentioned elsewhere. Any help much appreciated. Thanks

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

      String car is just a new variable that contains all the contents from the array, but instead of having to make an entire for loop etc you can just print it out in a foreach loop. At least that's how I understood it

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

    I think my professor said for each loops are mostly used for arrays. Is that right?

  • @AnkitRaj-bn5gp
    @AnkitRaj-bn5gp 3 роки тому

    hey Alex ! can we take input using "for each "loop or " stream.forEach() " ,,,,, please reply

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

    cheers pal

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

    How do you do for each loop for multidimentional arrays?

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

      Int no[][] = {{1,2,3},{4,5,6},{7,8,9}};
      for (int j[] : no)
      {
      for(int k : j)
      {
      System.out.print(k);
      }
      }
      If you want more video with logic see my channel playlist

  • @MaximumJoy
    @MaximumJoy 5 років тому

    Wonderful

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

      Int no[][] = {{1,2,3},{4,5,6},{7,8,9}};
      for (int j[] : no)
      {
      for(int k : j)
      {
      System.out.print(k);
      }
      }
      If you want more video with logic see my channel playlist

  • @thepowerx2965
    @thepowerx2965 5 років тому +1

    Good video! I 've a question: is it possible to put strings instead of integers in a if statement? in my code I put:
    if (name = "Jhon") {//do stuff}
    But I get error. Help pls
    PD: if there's a mistake is because I'm spanish so my english is sooo bad

    • @alexlorenlee
      @alexlorenlee  5 років тому +2

      Great question! Change it to name == "John" :)

    • @thepowerx2965
      @thepowerx2965 5 років тому

      @@alexlorenlee thanks! you're a very good teacher!

  • @steved.1754
    @steved.1754 4 роки тому

    Is foreach same as "enhanced" for loop?

  • @ARUNKUMAR-vi6uk
    @ARUNKUMAR-vi6uk 3 роки тому

    Can we use "FOR EACH" to all alternatives of FOR LOOPS?

  • @joshblank4579
    @joshblank4579 5 років тому

    for the last example with the array, what is "a" and why did you put "int a" in the for each loop?

    • @jukka4519
      @jukka4519 5 років тому

      You have a variable called "a" where the type of data that stores will be int (integers), when you run the foreach, every number is going to be stored in that variable. It's the same as the cars example but with numbers

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

    how can I convert that String car to a String array again?