File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Difference between array and arraylist

 
Kandi Srinath
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anyone suggest regarding this topic.
 
Rob Spoor
Sheriff
Pie
Posts: 20396
47
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Arrays can hold primitives and have a fixed length. ArrayList is a class that implements List that can only store objects and can grow as more elements are added.

But you could have found this out if you had checked the Java Language Specification for arrays and the Javadoc pages for ArrayList (just click on the word!).
 
Jim Hoglund
Ranch Hand
Posts: 525
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
They are very different beasts. Array is a more foundational concept, very
powerful and very general purpose. List is a utility interface with methods
like clear(), add() and remove(). The class ArrayList is a "Resizable array
implementation of the List interface." It uses an array behind the scenes.

Jim ... ...
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Pie
Posts: 15150
31
Android IntelliJ IDE Java Scala Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Arrays are a built-in feature of the Java programming language and JVM; ArrayList is just a class like any other class.
 
Rob Spoor
Sheriff
Pie
Posts: 20396
47
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which uses an array for its internal storage.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic