ArrayList

How to get a value located at a particular location in an ArrayList, say at index 3

please help.

[109 byte] By [Zorama] at [2007-11-27 11:46:55]
# 1

Use the get method.

Kaj

kajbja at 2007-7-29 18:10:15 > top of Java-index,Java Essentials,Java Programming...
# 2

@Op. You should normally read the javadoc before you ask:

http://java.sun.com/javase/6/docs/api/java/util/ArrayList.html

kajbja at 2007-7-29 18:10:15 > top of Java-index,Java Essentials,Java Programming...
# 3

ArrayList l1 = new ArrayList();

l1.get(int index);

AmitChalwade123456a at 2007-7-29 18:10:15 > top of Java-index,Java Essentials,Java Programming...
# 4

get(int index) Returns the element at the specified position in this list.

look at http://java.sun.com/j2se/1.4.2/docs/api/java/util/ArrayList.html

google it before u post in a forum

hnl2026a at 2007-7-29 18:10:15 > top of Java-index,Java Essentials,Java Programming...
# 5

then what do u want apart from element ?

AmitChalwade123456a at 2007-7-29 18:10:15 > top of Java-index,Java Essentials,Java Programming...
# 6

Thank you so much

Zorama at 2007-7-29 18:10:15 > top of Java-index,Java Essentials,Java Programming...