This post summaries the difference between Arrays and Collections.
Learn Java Collections framework at https://www.javaguides.net/p/java-collections-tutorial.html
Differences Between Arrays And Collections
| Arrays | Collections |
|---|---|
| Arrays are Fixed in Size. | Collections are Growable in Nature. |
| With Respect to Memory Arrays are Not Recommended to Use. | With Respect to Memory Collections are Recommended to Use |
| With Respect to Performance, Arrays are Recommended to Use. | With Respect to Performance Collections are Not Recommended to Use. |
| Arrays can Hold Only Homogeneous Data Elements. | Collections can Hold Both Homogeneous and Heterogeneous Elements. |
| Arrays can Hold Both Primitives and Objects. | Collections can Hold Only Objects but Not Primitives. |
| Arrays Concept is Not implemented based on Some Standard Data Structure. Hence Readymade Method Support is Not Available. | For every Collection class underlying Data Structure is Available Hence Readymade Method Support is Available for Every Requirement. |
Array
Collection Framework
Java
Comments
Post a Comment