cancel
Showing results for 
Search instead for 
Did you mean: 

Reg: ArrayList

Former Member
0 Kudos

Hi All,

I have a ArrayList in my application and some objects are added to that arraylist for ex: "arr.add("document");

I am unable to understand the concept of this arraylist. What type of attributes can be added to arraylist.

Thanks in advance.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Bharat,

You can add any Java object to the Array List. In the Java object heirarchy all the objects extends Object and hence you can add any Java object but not primitive types like int, float double etc. If you would like to add primitive types, go for the corresponding Java objects Float, Double etc. Hope I am clear here.

Thanks!

Surya.

Former Member
0 Kudos

Hi Bharath,

Check this:

<a href="http://java.sun.com/j2se/1.4.2/docs/api/java/util/ArrayList.html">http://java.sun.com/j2se/1.4.2/docs/api/java/util/ArrayList.html</a>

regards

Sumit

Former Member
0 Kudos

Hi,

ArrayList class is basically an implementation of List Interface.ArrayList class is implemented using dynamecally resizable array,provides fast random access and fast list traversal,but it's not thread-safe..Position based access is in leaner time for ArrayList.

regards,

Mithileshwar