lists and arrays

What is the difference between a list and an array?Why would you choose a list or an array over the other?I know a bit about arrays but i don't know much about lists but i think they are similar, are they?
[227 byte] By [RAWR-itsanONIONa] at [2007-11-27 4:29:50]
# 1
http://java.sun.com/docs/books/tutorial/java/nutsandbolts/arrays.html http://java.sun.com/docs/books/tutorial/collections/
jverda at 2007-7-12 9:38:58 > top of Java-index,Java Essentials,Java Programming...
# 2

in a program they can be used for many of the same purposes, using different syntax

at a lower level, an array is a group of objects laid out in a contiguous block of memory while a list is typically a group of objects where each entry has a pointer to the next entry

developer_jbsa at 2007-7-12 9:38:58 > top of Java-index,Java Essentials,Java Programming...
# 3
In English, what he means is that an array is constant (set up once and then left alone), and an array list (which I assume you you are referring to) is dynamic, values can be modified during execution.
sharokua at 2007-7-12 9:38:58 > top of Java-index,Java Essentials,Java Programming...
# 4

To answer your questions

> What is the difference between a list and an array?

due to abstraction in Java list and array, for most applications they are interchangeable

as for the implementation of the VM itself, in a native language such as C or C++, my previous post applies

> Why would you choose a list or an array over the

> other?

tough to give a general answer, usually case by case

for trivial usage this question is answered by syntax preference -- take your pick

developer_jbsa at 2007-7-12 9:38:58 > top of Java-index,Java Essentials,Java Programming...
# 5

> in a program they can be used for many of the same

> purposes, using different syntax

> at a lower level, an array is a group of

> objects laid out in a contiguous block of

> memory while a list is typically a group

> of objects where each entry has a pointer to the

> next entry

This is also nonsense. What you are describing for a list is a linked list, which is a list but does not be any means encompass all of them.

cotton.ma at 2007-7-12 9:38:58 > top of Java-index,Java Essentials,Java Programming...
# 6
> array is constant (set up once and then left alone)I sure hope you are referring to the size and not the elements within the array.
floundera at 2007-7-12 9:38:58 > top of Java-index,Java Essentials,Java Programming...
# 7
P.S. Good to see you have returned cotton!
floundera at 2007-7-12 9:38:58 > top of Java-index,Java Essentials,Java Programming...
# 8
> P.S. Good to see you have returned cotton!Hey flounder. Thanks.
cotton.ma at 2007-7-12 9:38:58 > top of Java-index,Java Essentials,Java Programming...
# 9
thanks to all who have helped, I think i understand it a bit now
RAWR-itsanONIONa at 2007-7-12 9:38:58 > top of Java-index,Java Essentials,Java Programming...