Hacker News new | ask | show | jobs
by skneko 1695 days ago
> E.g., correct usage of arrays vs. ArrayList.

Arrays vs lists is a thing in all languages, not Java. They just have different names (list, vector, sequence...)

1 comments

I don’t think Ruby or Python have linked lists, only arrays.
Ruby and python only have an equivalent to Java’s “array list.” It’s not in the standard library, but you can trivially make linked list nodes yourself if the problem calls for it; I don’t remember encountering a need for the data structure over the built in array-list type outside of interview questions anyways.
ArrayList is not a linked list, it's an array-backed list like List in C# or other languages, like the name implies. Linked list is `java.util.LinkedList`.