Java67 - Java Program Example Tutorial Blog

Java67 - Java Program Example Tutorial Blog


Difference between Array vs ArrayList in Java

Posted: 14 Dec 2012 04:55 AM PST

What is difference between Array and ArrayList is quite a common question among beginners especially who started coding in C and C++ and prefer to use Array. Both Array and Array List are used to store elements, which can be either primitive or objects in case of Array and only objects in case of ArrayList in Java. Main difference between Array vs ArrayList in Java is static nature of Array and dynamic nature of ArrayList. Once created you can not change size of Array but ArrayList can re-size itself when needed. Another notable difference between ArrayList and Array is that Array is part of core Java programming and has special syntax and semantics support in Java, While ArrayList is part of Collection framework along with other popular classes e.g. Vector, Hashtable, HashMap or LinkedList. Let's see some more difference between Array and ArrayList in Java in point form for better understanding.
Read more »


Post a Comment