File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "java" Watch "java" New topic


pawan sharma

Joined: Feb 12, 2001
Posts: 7
what is main difference between array ana arraylist.
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
It's easier to just check out the API. I know arrays contains various methods for manipulating arrays. ArrayList on the other hand is just like a vector, but probably has a few more methods.

So much trouble in the world -- Bob Marley
Rahul Mahindrakar
Ranch Hand

Joined: Jul 28, 2000
Posts: 1868
Welcome to Javaranch.
This is not an apt forum for your question. You can post similar questions in Java in General forums. Anyhow the following differences some to my mind immediately

Can contain primitive types and Objects
Non Resizable
Supported at the java language level
all contained components of same type
Can only Contain Objects
Resizable-array implementation
Part of Collecions framework thus you have to import java.util to use it
all contained components may be of same type or different types.
Frank Carver

Joined: Jan 07, 1999
Posts: 6920
I've moved this post to Java in General (beginner)

Read about me at ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
I agree. Here's the link:
subject: java
It's not a secret anymore!