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

  Рет қаралды 489,133

Coding with John

Coding with John

3 жыл бұрын

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...

Пікірлер: 520
@whatisahandleeee
@whatisahandleeee 2 жыл бұрын
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 Жыл бұрын
who is rest?
@whatisahandleeee
@whatisahandleeee Жыл бұрын
@@ilhammammadli4560 Corey Schafer is one of them for sure.
@sophie6425
@sophie6425 Жыл бұрын
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 жыл бұрын
PLEASE DONT STOP TEACHING THIS THINGS.. I HAVE WATCHED A LOT OF GUYS LIKE U ON KZfaq AND UR ONE OF THE BEST. AND STILL I LOVE JAVA MORE EVEN AFTER MEETING PYTHON
@trynafindkaygee_
@trynafindkaygee_ 2 жыл бұрын
i can relate to that❤😎👌
@spacepowerofficial1187
@spacepowerofficial1187 Жыл бұрын
I didn't see the DONT and I got really confused
@butterandjamtoast
@butterandjamtoast Жыл бұрын
Caps Lock. The cruise control to cool 😎
@user-pp1cn2ut4y
@user-pp1cn2ut4y Жыл бұрын
Axper angleren chem xosum ches kara bacatres incha patmum?
@darrenfrancis8126
@darrenfrancis8126 Жыл бұрын
@@spacepowerofficial1187 PLEASE STOP TEACHING imagine
@kerwinso
@kerwinso 2 жыл бұрын
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 жыл бұрын
you are going to have million subscribers one day, already telling ya, you teach so well :)
@wankhede09
@wankhede09 2 жыл бұрын
I Second that
@CheeseStickzZ
@CheeseStickzZ 2 жыл бұрын
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 жыл бұрын
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
@shirinelmanson7839
@shirinelmanson7839 3 жыл бұрын
I am literally I am shocked how come you do not have 1 million subscribes ..the way you teach is awsome.
@oldschoolmath8480
@oldschoolmath8480 3 жыл бұрын
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.
@filipemelo1107
@filipemelo1107 2 жыл бұрын
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.
@thecolorblue7427
@thecolorblue7427 2 жыл бұрын
I was not expecting such a easy to understand, and great tutorial like this! thank you so much
@aces8481
@aces8481 2 жыл бұрын
you are 100% my go to person on KZfaq for beginner tutorials -> explanations are always really beginner friendly and so clear and easily digestible. Thanks a ton man
@tbone587
@tbone587 2 жыл бұрын
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
@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.
@miigon9117
@miigon9117 3 жыл бұрын
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 KZfaq!!!
@robertjr8205
@robertjr8205 2 ай бұрын
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!
@osanbrazil999
@osanbrazil999 Жыл бұрын
You're the best because you speak fast and get direct to the point with the exact needed amount of information, period.
@gabrielmicillo7763
@gabrielmicillo7763 2 жыл бұрын
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! 🙏🏽👏🏾👏🏾👏🏾👏🏾👏🏾
@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!
@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
@mk17173n
@mk17173n Жыл бұрын
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.
@tinongsot6267
@tinongsot6267 2 жыл бұрын
This channel is really underrated, I learned a lot just from this video. You’re doing great. Thank you John
@carlosgranda8493
@carlosgranda8493 2 жыл бұрын
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 Жыл бұрын
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
@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 !
@HuwJones
@HuwJones Жыл бұрын
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.
@preciouspearl8583
@preciouspearl8583 Жыл бұрын
Thumbs up i searched so many tutorials but find yours the straight to the point one
@Charnelex
@Charnelex 2 жыл бұрын
John, I'm just getting started in Java and I appreciate you. Commenting to help the algorithm.
@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
@danielbressner6125
@danielbressner6125 2 жыл бұрын
Yet another great walkthrough. This channel has been such a huge help in my own Java journey.
@michaelekpo4011
@michaelekpo4011 Жыл бұрын
Thanks Coding with John! One of the best videos I've seen throwing so much light on this subject.
@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.
@Timeless_Trader
@Timeless_Trader Жыл бұрын
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
@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!
@masikajenniffer6473
@masikajenniffer6473 2 жыл бұрын
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
@CoolBear619
@CoolBear619 4 ай бұрын
Thanks much John! Because of you I have cracked 2 interviews. Loads of love from India. Keep teaching us!🎉
@sajidamoin771
@sajidamoin771 24 күн бұрын
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 ❤️
@ralphgore3543
@ralphgore3543 2 жыл бұрын
John, I discovered you yesterday and you are one of the best!
@mastermatt6090
@mastermatt6090 2 ай бұрын
Thanks dude, you make everything so simple!
@malodeity
@malodeity 3 ай бұрын
I'll be the first to admit that I've been all over KZfaq but you different and you make it so easier to understand. Thanks
@TornadoeJoe
@TornadoeJoe 2 жыл бұрын
Thanks for the help! Java is an interesting language so far, and this definitely helped me see things a bit better.
@banglepq
@banglepq 2 жыл бұрын
Thank you John so much for this video. It's really helpful for me to understand differences between array and arraylist.
@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
@fridolinmeier661
@fridolinmeier661 Жыл бұрын
Just searched for a good video and wow I could not have found a better one. Thanks a lot.
@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.
@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
@anddavinci6691
@anddavinci6691 6 ай бұрын
Thank you so much! I’ve been learning so much faster since I have started watching your videos.
@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.
@charmainemarasigan8994
@charmainemarasigan8994 Жыл бұрын
Superb training. Not boring! Very educational! Highly recommended
@abdullahpopalzai6543
@abdullahpopalzai6543 2 жыл бұрын
Please do not stop teaching, you are great!!!!!!
@EnfalOlgun
@EnfalOlgun 4 ай бұрын
What a beautiful explanation. Stunning, absolutely stunning. Thank a lot John.
@maryozonkwor-ei8vw
@maryozonkwor-ei8vw 6 күн бұрын
Just what i am looking for. And u explain like swift and smooth . Tnx
@raba650
@raba650 2 жыл бұрын
What a great walkthrough! Really enjoyed it. Now to binge on some more of your videos :)
@AnaCristina-ve7wh
@AnaCristina-ve7wh Ай бұрын
Thanks, you're a great teacher!! It's incredible how you can make it so easy to understand
@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.
@s6031417
@s6031417 Жыл бұрын
This video took me only 17 mins to get fully understand the basic concept of Array and ArrayList. Thank you.
@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!!!
@zachjs2721
@zachjs2721 Күн бұрын
I learn more from you than college professors. You flow through your explanations and it really helps someone like me with adhd lol
@daniella9498
@daniella9498 5 ай бұрын
I'm using these videos to prepare for my first year Java course. Thank you so much!
@AdrianTregoning
@AdrianTregoning 2 жыл бұрын
Absolute gold. Very well explained! Thank you John.
@matiasmoresi5040
@matiasmoresi5040 Жыл бұрын
Hey John! Thank you very much for taking the time to teach like this
@bbalmer7878
@bbalmer7878 8 ай бұрын
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.
@nicholi8933
@nicholi8933 Жыл бұрын
This was super useful. I was forced to use an arraylist in this program and everything I was doing was not working. Though mine is a bit different since they are class objects, I figured it out with your help. Thank you so much. Arraylist remind me of arrays in python.
@alessioharo7995
@alessioharo7995 Жыл бұрын
You're such a great teacher. Thank you for what you do! I love your videos
@HatTrick4030
@HatTrick4030 Жыл бұрын
Awesome!! as a refresher I alwasy have to come back and re-study the already-studied topics. Thanks for this great video
@saudaminisawant961
@saudaminisawant961 Ай бұрын
Excellent explanation of concepts ....great John
@AsrorkhanProgrammer
@AsrorkhanProgrammer 2 жыл бұрын
In a simple case, a and very understandable prepared lesson Thank you, John
@patrykgwardzik4509
@patrykgwardzik4509 Жыл бұрын
Man i just love you so much. This is so clear and understandable.
@Av-fn5wx
@Av-fn5wx 6 ай бұрын
Brilliantly explanation. Clear and concise ❤
@sdaltnts6774
@sdaltnts6774 3 жыл бұрын
Thank you very much John. You explained clearly. I love your channel.
@jordans3611
@jordans3611 Жыл бұрын
Keep this up man, your videos are helping me so much!
@jorgegutierrez2100
@jorgegutierrez2100 2 жыл бұрын
Quality content, great at teaching, quality video and the most important for me is that as a non native English speaker I can perfectly understand everything you're saying. This channel deserves at least 1 million subscribers and hundreds of thousands views. Keep it up, man. 🥂
@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!
@darthvasilis
@darthvasilis Жыл бұрын
Amazing. In 15 minutes I've learned more from you than I have in 10 weeks from my CSC205 professor...
@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.
@thekevinfx-krouxer
@thekevinfx-krouxer 3 жыл бұрын
English is not even my first language but I understood most of the things you said, this is pretty helpful, you will be big one day
@javierherrero7011
@javierherrero7011 Жыл бұрын
John, you are an excellent excellent teacher....I have seen many of your Java videos, always learn fast and solid
@nathanelliott9729
@nathanelliott9729 2 жыл бұрын
Thank you so much, I learned more from this video than a 2 hour lecture from my professor.
@TrueNDiary
@TrueNDiary 2 жыл бұрын
Thank you John for simplifying the subject of Array & ArrayList, please consider doing tutorials with IntelliJ IDEA CE, much appreciated!
@justinbanza4751
@justinbanza4751 2 жыл бұрын
I really appreciated this video. Thanks for all the work to make it!
@NajmaMiah
@NajmaMiah Жыл бұрын
Great explanation! Thank you. Please keep posting
@minakianrad812
@minakianrad812 Жыл бұрын
Thank you for this AWESOME video of the differences between arrays and arraysList. !!!! You explained it very clearly, down to the point, with great examples!!!! Thank you for making this video and sharing your knowledge and expertise with the world. You are Outstanding! Thanks again! And you also got a new subscriber! 🙂
@aravindhkumar69
@aravindhkumar69 Жыл бұрын
You are really superman.. Because your video helpful to everyone... I saw a video from tamilnadu in south India....... Your are my best teacher
@sweetshoez
@sweetshoez 11 ай бұрын
Thanks again this is exactly what I needed coming from more user-friendly languages
@manuelklm
@manuelklm 2 жыл бұрын
Awesome Video! I didn't know that ArrayList can be this useful👍 What I always wanted to do, is to have the ability to add things to my List of items. And now I know how! 🙂
@williamowusu7778
@williamowusu7778 2 ай бұрын
Very helpful and easy to comprehend
@stephenfoster9009
@stephenfoster9009 Ай бұрын
I’m new to Java and need to learn for my job. Thanks for the videos!
@gunnerxt
@gunnerxt Жыл бұрын
You cannot believe how much my future is dependent on you. Keep at it John. Your work is amazing man. God bless
@graphzapf6220
@graphzapf6220 2 жыл бұрын
Hi John, First of all I appreciate your effort and work. So thank you very much. In one of your collection videos you compared arrayList vs Linked list and there you told that the arrayList has a default size of 10 and by need it grows. Now here you did not mentioned it as far as I could remember.
@aashishgupta9392
@aashishgupta9392 Жыл бұрын
love from India bro....u know exactly how to teach....just amazing
@PCRduino
@PCRduino 2 жыл бұрын
Brilliant and clear explanation! Thanks!
@moabdellatif5699
@moabdellatif5699 2 жыл бұрын
just perfect and simple, thank you John
@aadi.p4159
@aadi.p4159 3 жыл бұрын
clean precise and too the point.. big ups bro
@sambhavkumath
@sambhavkumath Жыл бұрын
thanks for making such an awesome lecture. hoping for more such tutorials
@pezeng
@pezeng 2 жыл бұрын
Your video was so easy for learning, Please keep doing this. it help me a lot in java learning
@SkyeVintorez
@SkyeVintorez 2 жыл бұрын
i love all your videos! it helps a lot and explained very well.. please keep on making videos about java..
@rashmikadeshan2710
@rashmikadeshan2710 Жыл бұрын
Thank you so much for making video like this. You explained the difference between arrays and arrylist very clearly .therefore i could understand it. keep up th good work.❤️
@willmccallum4932
@willmccallum4932 Жыл бұрын
I normally do not comment on videos but I was very impressed by this video. I would not consider myself a newbie when it comes to coding with java. With that being said to often video do not go in-depth enough to to explain advanced questions relating to specific topics. Right now I am studying micro process relating to java. You answered my question on whether ArrayList are dynamic or fixed along with answer my question on whether or not this micro process would have a large impact on the run time. With that being said I still have one question about ArrayList you did not answer, ArrayList use the generic indicator "< >"(Dimond operator). I was hoping to learn more about how this aspect of ArrayList ties into its functionality. As of right now my understanding is that ArrayList work as a generic class, allowing it to take in/store a wide range of data types. if this is the case I would love to know more about how this ties into the fact it cant work with primitive types and only objects of type class(rapper classes). If you have any resources or information on why ArrayList use the generics indicator "< >" I would love to look into it. Once again thank you for your very informitave video.
@FelipeGomesProfessor
@FelipeGomesProfessor Жыл бұрын
Great content!! Really easy to understand for a beginner. Thanks!
@christpoic
@christpoic 2 жыл бұрын
Wow this explained clearly what i've learned in a 3 hours java course in univ.
@valerietremblay3235
@valerietremblay3235 2 жыл бұрын
Thank you so much for these clear & concise videos!
@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.
Set and HashSet in Java - Full Tutorial
20:43
Coding with John
Рет қаралды 192 М.
Generics In Java - Full Simple Tutorial
17:34
Coding with John
Рет қаралды 1 МЛН
когда достали одноклассники!
00:49
БРУНО
Рет қаралды 3,7 МЛН
КАК СПРЯТАТЬ КОНФЕТЫ
00:59
123 GO! Shorts Russian
Рет қаралды 3,1 МЛН
CAN YOU HELP ME? (ROAD TO 100 MLN!) #shorts
00:26
PANDA BOI
Рет қаралды 36 МЛН
New Java Version 22 - The 3 Best New Features You'll ACTUALLY Use
13:15
Coding with John
Рет қаралды 86 М.
Java Main Method Explained - What Does All That Stuff Mean?
7:10
Coding with John
Рет қаралды 217 М.
Exception Handling in Java Tutorial
13:20
Coding with John
Рет қаралды 355 М.
Java arrays 🚗
6:26
Bro Code
Рет қаралды 172 М.
LinkedList vs ArrayList in Java Tutorial - Which Should You Use?
11:43
Coding with John
Рет қаралды 569 М.
Lambda Expressions in Java - Full Simple Tutorial
13:05
Coding with John
Рет қаралды 697 М.
Map and HashMap in Java - Full Tutorial
10:10
Coding with John
Рет қаралды 531 М.
Java Strings are Immutable - Here's What That Actually Means
7:06
Coding with John
Рет қаралды 601 М.
Apple watch hidden camera
0:34
_vector_
Рет қаралды 53 МЛН
Куда пропал 3D Touch? #apple #iphone
0:51
Не шарю!
Рет қаралды 993 М.
ПК с Авито за 3000р
0:58
ЖЕЛЕЗНЫЙ КОРОЛЬ
Рет қаралды 1,7 МЛН