Thanks for the great tutorials, I had a question, why does array list store the pointers instead of the actual data, what's the benefit of having the actual data NOT to be stored contiguously across the memory?
I think I "kinda" found out why it stores pointers instead of actual value, is it because array lists are made for having dynamic capacity, so they're most likely going to increase their capacity, and if they contain the values, it's more expensive to copy all those values to the new array, and it'll be less expensive if we just copy the references to a new array, is this the reason?
It's just because in Java you are not working directly with the object itself but with a reference to that object. So when you pass an object to the ArrayList you are adding a reference to that object in memory.
Actually, it is interesting to know that ArrayList is an array of pointers but the question is how ArrayList is dynamic, mean if the array list is an array of pointers isn't that mean that the pointers' array has also a fixed size?
So, python lists is another data structure that needs to be study own its own ? I'm a data analyst and always get errors between arrays and lists to implement algorithms to new data. Thank you in advance,
Python lists are very confusing indeed and probably could be a whole separate video. If you are getting errors I would recommend the numpy libray. It's extremely good for working with arrays and lists in python.
@@NullPointerException well it worked on me because I came and subscribed. Great content guys. Maybe tone down the adds per minute on that one would not hurt. Thanks a lot for the help and cheers!
Didn’t really follow about classes and objects. aside from that understood everything else. Thank you so much for this content
In 10:39, the correct formula should be nameoffunction.set(Index,Object). This is based on my observation towards your video. I hope I am right.
great video! easy to understand. thanks
Glad it helped!
Consider making some content on Design patterns in java too :)
Thanks for the idea! We will add it to the list
Loved it!
Thanks for the great tutorials, I had a question, why does array list store the pointers instead of the actual data, what's the benefit of having the actual data NOT to be stored contiguously across the memory?
I think I "kinda" found out why it stores pointers instead of actual value, is it because array lists are made for having dynamic capacity, so they're most likely going to increase their capacity, and if they contain the values, it's more expensive to copy all those values to the new array, and it'll be less expensive if we just copy the references to a new array, is this the reason?
It's just because in Java you are not working directly with the object itself but with a reference to that object. So when you pass an object to the ArrayList you are adding a reference to that object in memory.
Actually, it is interesting to know that ArrayList is an array of pointers but the question is how ArrayList is dynamic, mean if the array list is an array of pointers isn't that mean that the pointers' array has also a fixed size?
So, python lists is another data structure that needs to be study own its own ?
I'm a data analyst and always get errors between arrays and lists to implement algorithms to new data.
Thank you in advance,
Python lists are very confusing indeed and probably could be a whole separate video. If you are getting errors I would recommend the numpy libray. It's extremely good for working with arrays and lists in python.
You are doing a great job. Instantly Subscriber the channel.
Thanks and welcome!
The list boxing/autoboxing is relevant only for java, c# can have generics on primitive types.
Good catch! I'll make sure to fix that section for the megacut
Why does the memory not keeping the data contiguously?
So that the arrayList is able to expand in size unlike a normal array.
freecodecamp got this content and uploaded with tons of adds interrupting the presentation. whatch here is much better
We actually partnered with freecodecamp to get the video out to a much larger fanbase so more people are able to learn from it.
@@NullPointerException well it worked on me because I came and subscribed. Great content guys. Maybe tone down the adds per minute on that one would not hurt. Thanks a lot for the help and cheers!