Array vs. ArrayList in Java Tutorial - What's The Difference?

Поділитися
Вставка
  • Опубліковано 22 лют 2021
  • Arrays vs. ArrayLists - What's the difference? How do you use each of them, and which one should you use and why?
    We'll go in-depth about the similarities and differences between Array and ArrayList in Java, and talk about how to create them, add elements, remove elements, and more.
    This is a beginner friendly beginner's Java coding lesson tutorial, where we'll talk all about using Arrays and ArrayLists.
    Learn or improve your Java by watching it being coded live!
    Hey, I'm John! I'm a Lead Java Software Engineer who has been in the industry for over a decade. I love sharing what I've learned over the years in a way that's understandable.
    Let me know what else you'd like to see!
    Links to any stuff in this description are affiliate links, so if you buy a product through those links I may earn a small commission.
    📕 THE best book to learn Java, Effective Java by Joshua Bloch
    amzn.to/36AfdUu
    📕 One of my favorite programming books, Clean Code by Robert Martin
    amzn.to/3GTPVhf
    🎧 Or get the audio version of Clean Code for FREE here with an Audible free trial
    www.audibletrial.com/johnclean...
    🖥️Standing desk brand I use for recording (get a code for $30 off through this link!)
    bit.ly/3QPNGko
    📹Phone I use for recording:
    amzn.to/3HepYJu
    🎙️Microphone I use (classy, I know):
    amzn.to/3AYGdbz
    Donate with PayPal (Thank you so much!)
    www.paypal.com/donate/?hosted...
    ☕Complete Java course:
    codingwithjohn.thinkific.com/...
    codingwithjohn.com
    Full source code available here: codingwithjohn.com/array-vs-a...
  • Наука та технологія

КОМЕНТАРІ • 523

  • @whatisahandleeee
    @whatisahandleeee 2 роки тому +362

    Easily top 3 programming teachers on youtube. No joke. You seem to answer the exact questions that a newbie would asks and you answer in such a way that gives exactly the information that is needed.

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

      who is rest?

    • @whatisahandleeee
      @whatisahandleeee Рік тому +5

      @@ilhammammadli4560 Corey Schafer is one of them for sure.

    • @sophie6425
      @sophie6425 Рік тому +4

      Agreed! I´m a first semester Computer Science student and we must do these little coding exercises. The lectures don´t really help, but these videos really got me through these tasks.

  • @glefordbanglayan5322
    @glefordbanglayan5322 3 роки тому +325

    PLEASE DONT STOP TEACHING THIS THINGS.. I HAVE WATCHED A LOT OF GUYS LIKE U ON UA-cam AND UR ONE OF THE BEST. AND STILL I LOVE JAVA MORE EVEN AFTER MEETING PYTHON

  • @kerwinso
    @kerwinso 2 роки тому +115

    You explain diamond operators (starting at 4:19) in 20 seconds better than others who have taken over 5 minutes. Well done sir.

  • @sanabil2531
    @sanabil2531 3 роки тому +263

    you are going to have million subscribers one day, already telling ya, you teach so well :)

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

      I Second that

    • @CheeseStickzZ
      @CheeseStickzZ 2 роки тому +9

      That's a nice notion but no he wont. Programming is not that popular. Only stupid things are popular, entertainment and food and monkeying around

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

      I agree... he is great teacher, I love his coding tutorials cuz they are the ones that are among the most understandable and well-explained:)

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

      indeed

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

      He is close

  • @filipemelo1107
    @filipemelo1107 2 роки тому +6

    I freaking love the way you approach the subject on your videos... It's so simple and yet, complete; I can understand everything so easily.

  • @shirinelmanson7839
    @shirinelmanson7839 3 роки тому +10

    I am literally I am shocked how come you do not have 1 million subscribes ..the way you teach is awsome.

  • @oldschoolmath8480
    @oldschoolmath8480 3 роки тому +22

    Thanks so much for sharing this video! We watched this in my AP CS A course after finishing a unit on Arrays and you did a great job of giving us an intro to ArrayLists.

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

    This dude is the man. His videos are better than others because he answers the question why. Why do we do it this way? Keep it up dude.

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

    you are 100% my go to person on UA-cam for beginner tutorials -> explanations are always really beginner friendly and so clear and easily digestible. Thanks a ton man

  • @thecolorblue7427
    @thecolorblue7427 2 роки тому +21

    I was not expecting such a easy to understand, and great tutorial like this! thank you so much

  • @HuwJones
    @HuwJones Рік тому +33

    Great video. Two things....it's considered good practice to use the interface on the left side so List instead of ArrayList before the variable name. And while you are right that the ArrayList itself can grow and shrink it's really important to be aware that the array that backs the ArrayList (yes there's an array hiding inside the ArrayList implementation!) does not shrink automatically after the ArrayList has grown...this can be very significant when profiling the memory footprint of an application. Lastly, it would be really good to have a video on why you'd pick a primitive representation over its Object form.....performance, memory usage, etc.

  • @miigon9117
    @miigon9117 3 роки тому +7

    Cool video. So informative yet so clear and easy to understand. I’m learning java programming as a hobby language and your explanation is the best I have seen on UA-cam!!!

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

    You're the best because you speak fast and get direct to the point with the exact needed amount of information, period.

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

    I been using java for over a decade and I have still been enjoying your videos! You explain things very well and even these basic concepts are engaging to watch lol

  • @robertjr8205
    @robertjr8205 2 місяці тому +1

    Watching your videos helps me understand so much better. You explain everything perfectly and add in the little important details that most books or instructors seem to not mention,
    Thank you!

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

    I've been out of the Java Ecosystem for years, but I randomly got to your channel I have been enjoying just listening on some of the details of Java again. Great content.

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

    Dude, I swear to God how can you explain so well that I didn't get distracted. bro when my teachers explain I lose focus so fast, dude keep it going you are amazing.

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

    I love how my school explains these things in 10 videos and it takes over 5 hours to watch all of them, while I can easily learn it from your video in just 18 min

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

    Thumbs up i searched so many tutorials but find yours the straight to the point one

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

    This channel and its content its excellent.. im learning Java and I found it so much easier with these videos than my actual lectures. Also the edition of these videos is great. Please dont ever stop making videos about Java. I honestly think is by far the best there is on youtube, and all divided on little videos so it doesnt feel overwhelming like starting a new course.

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

    My first video and I just want to say that please keep going. This helped me in so many ways. Easy to understand explanation and very helpful interaction. God bless you. You have a subscriber! 🙏🏽👏🏾👏🏾👏🏾👏🏾👏🏾

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

    This channel is really underrated, I learned a lot just from this video.
    You’re doing great. Thank you John

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

    Yet another great walkthrough. This channel has been such a huge help in my own Java journey.

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

    this is the best java tutorial i have ever watch , i wish John had a complete series from the basics up, i can beat my chest and say i understand the differences between Arrays and Array list, I recommend it for anyone looking up the internet for answers to arrays and array list

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

    Thanks Coding with John! One of the best videos I've seen throwing so much light on this subject.

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

    Such a lifesaver, I'm currently working for our activity involving arrays and this video showed up. Very informative, no subtle introduction just worth of my remaining time haha. Thank you so much!

  • @zachjs2721
    @zachjs2721 13 днів тому

    I learn more from you than college professors. You flow through your explanations and it really helps someone like me with adhd lol

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

    This is amazing.The explanation is really easy to follow and understand. I hope many more people can watch and subscribe. Thanks for the tutorial

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

    Awesome ! Learning java, coming from c++ and js background. This man has taught so much stuff so easily and quickly. Thanks a ton John !

  • @mastermatt6090
    @mastermatt6090 2 місяці тому +1

    Thanks dude, you make everything so simple!

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

    Thanks John. This is a great learning. I would recommend this channel to my friends too because things explained are to the point, no random things. Thanks again. Subscribed

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

    John, I'm just getting started in Java and I appreciate you. Commenting to help the algorithm.

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

    John, I discovered you yesterday and you are one of the best!

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

    What a great walkthrough! Really enjoyed it. Now to binge on some more of your videos :)

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

    Just searched for a good video and wow I could not have found a better one. Thanks a lot.

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

    Awesome way of teaching John.. please don't stop teaching at any cost. This really helps a lot of people !! you deserve more subscribers

  • @AnaCristina-ve7wh
    @AnaCristina-ve7wh Місяць тому

    Thanks, you're a great teacher!! It's incredible how you can make it so easy to understand

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

    Man i just love you so much. This is so clear and understandable.

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

    Thank you so much for all of your videos. You got a new follower, and you are really good at explaining java. Hope to see your channel grow!!!

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

    You are one of the smartest teachers on youtube… I love your teaching style…Whenever I want to learn a java topic, I first search it on your channel because you explain every topic in a very simple way. Not too much of information not too less… just as much as needed for a beginner… My favorite ❤️

  • @wayneinteressierts9973
    @wayneinteressierts9973 11 місяців тому

    Man, John! Thank you so much! I‘m about to start my first developer job and see your videos daily! You are so great help!!! Please keep going!

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

    Please do not stop teaching, you are great!!!!!!

  • @TornadoeJoe
    @TornadoeJoe 2 роки тому +6

    Thanks for the help! Java is an interesting language so far, and this definitely helped me see things a bit better.

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

    Hey John! Thank you very much for taking the time to teach like this

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

    Your are awesome man ❤️
    You teach so nice. You are adding every information about the topic into a single video. And also videos are not too lengthy.
    Loved to watch every videos you posted.
    Don't stop please.

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

    Awesome!! as a refresher I alwasy have to come back and re-study the already-studied topics. Thanks for this great video

  • @maryozonkwor-ei8vw
    @maryozonkwor-ei8vw 18 днів тому

    Just what i am looking for. And u explain like swift and smooth . Tnx

  • @footballplayer3195
    @footballplayer3195 10 місяців тому

    you are my hero man, I've been using fixed array my whole life, you're best than my professors in college

  • @CoolBear619
    @CoolBear619 5 місяців тому

    Thanks much John! Because of you I have cracked 2 interviews. Loads of love from India. Keep teaching us!🎉

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

    Dude, thanks a lot. I’m from Brazil and just had 3 hours of class in my own language and couldn’t get what I got in 17 min in your video. U r a legend.

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

    Absolute gold. Very well explained! Thank you John.

  • @anddavinci6691
    @anddavinci6691 6 місяців тому

    Thank you so much! I’ve been learning so much faster since I have started watching your videos.

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

    Thank you John so much for this video. It's really helpful for me to understand differences between array and arraylist.

  • @bbalmer7878
    @bbalmer7878 9 місяців тому +1

    as I was watching I thought "BUT-BUT you cant DO THAT!" and then you wrote "//you can't do that "
    and i got just a nice ass dopamine hit, thank you.

  • @Av-fn5wx
    @Av-fn5wx 6 місяців тому

    Brilliantly explanation. Clear and concise ❤

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

    You're such a great teacher. Thank you for what you do! I love your videos

  • @EnfalOlgun
    @EnfalOlgun 5 місяців тому

    What a beautiful explanation. Stunning, absolutely stunning. Thank a lot John.

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

    I'll be the first to admit that I've been all over UA-cam but you different and you make it so easier to understand. Thanks

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

    Superb training. Not boring! Very educational! Highly recommended

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

    Great explanation! Thank you. Please keep posting

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

    Thank you very much John. You explained clearly. I love your channel.

  • @lootster
    @lootster 11 місяців тому +1

    UA-cam algo sucks for not recommending this wonderful video for Java learner! But better late than never!

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

    I really appreciated this video. Thanks for all the work to make it!

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

    i love how you explained this rn and em crying co'z I really don't understand it at first. so yeah thank you so much john.

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

    Thank you so much, I learned more from this video than a 2 hour lecture from my professor.

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

    Keep this up man, your videos are helping me so much!

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

    This video took me only 17 mins to get fully understand the basic concept of Array and ArrayList.
    Thank you.

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

    Liked this video , John. I have started to code in Java , after 1.5 year with C and C++. Now i'm learning some differences from you. Keep up.

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

    Amazing. In 15 minutes I've learned more from you than I have in 10 weeks from my CSC205 professor...

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

    In a simple case, a and very understandable prepared lesson Thank you, John

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

    Very helpful and easy to comprehend

  • @daniella9498
    @daniella9498 5 місяців тому

    I'm using these videos to prepare for my first year Java course. Thank you so much!

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

    Excellent explanation of concepts ....great John

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

    this video really deserves that thumbs up. Tnx

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

    Glad that you've mentioned that ArrayList do so much behind the scenes, I'd have loved to see you go more in depth regarding the difference in speed and how they really work at a lower level, But again as you said the difference between both is barely noticeable.
    Thanx dude keep at it

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

    Great job John!!! Keep it up!

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

    Thank you ,thank you, thank youuu, ur courses are so special, so easy to understand the concepts, thank you so much.

  • @user-ur3gr2qs6i
    @user-ur3gr2qs6i 2 роки тому

    Thanks for the videos, they are really easy to follow. Great for review of core concepts as well as an intro for those just learning Java, you and Carl do good work!

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

    just perfect and simple, thank you John

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

    John, you are an excellent excellent teacher....I have seen many of your Java videos, always learn fast and solid

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

    wooow ,very clean and understandable explanation all , thanks for sharing with us

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

    i love all your videos! it helps a lot and explained very well.. please keep on making videos about java..

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

    Thank you so much for these clear & concise videos!

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

    Great content!! Really easy to understand for a beginner. Thanks!

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

    That was great, you really illuminated some stuff

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

    Thank you so much for your videos, I really like and learn a lot from them.

  • @ikromovich_b
    @ikromovich_b 2 місяці тому

    you are an awesome man. i got a lot of things from this lesson and thank you for lessons👍

  • @sweetshoez
    @sweetshoez 11 місяців тому

    Thanks again this is exactly what I needed coming from more user-friendly languages

  • @aadi.p4159
    @aadi.p4159 3 роки тому +1

    clean precise and too the point.. big ups bro

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

    Really enjoying your videos!!! Keep it up!! Thank you!!!!

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

    Wow the best explanation ever. Thank you Sir.

  • @kocovali7295
    @kocovali7295 4 місяці тому

    my english its not so good, but you speak so clearly so nice i understand everything in your videos. As an Java beginner i am very very thankfull to you!

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

    90% of my Java class success is owed to you. thanks man!

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

    You cannot believe how much my future is dependent on you. Keep at it John. Your work is amazing man. God bless

  • @xiaoxiao717
    @xiaoxiao717 3 роки тому +10

    Very clear and detail, it really helps a lot! Will subscribe and hope to see more videos soon!

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

    Great video! Explains so good.

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

    Love the practical way you teach

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

    Hay John, Thanks for the beautiful tutorials, its littel hard to understand you as i am very biggner, but eventually you made your point very clear.

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

    Such an incredibly useful video!!!!!

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

    Thanks. Your lessons are great. You simplify matters, you consider students cognition over showing your talent, which you undoubtedly have. Some teachers focus on proving their excellence more than a student’s need, level and ability.