Difference between array and arraylist.

Answer Posted / mohammad fazulullah

Array is the object and it stores the object of same type

Eg : Its stores complete integer types or string types

int[] IntArray = new int[3];
string[] StringArray = new StringArray[2];

Arraylist is the collection in which we can store the
objects of any data type.

Eg : Arraylist Arr = new Arraylist()
Arr.Add(13); // Integer Type
Arr.Add(10); // String Type

2 . Arrays has the Fixed Lenght where as the Arraylist
varies the leghth as the objects Added.

Is This Answer Correct ?    196 Yes 32 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the different types of multitasking?

651


How to use string tokenizer class.

614


What is a function easy definition?

525


What is a double vs float?

532


Which is bigger float or double java?

520






What is the difference between the paint() and repaint() methods in java programming?

621


What is singleton class in ruby?

557


Explain the features of java?

589


Why enumeration is faster than iterator?

527


How do you override a method?

547


What is port number in java?

585


What is the vector class in java programming?

561


How finally used under exception handling?

510


What does file separator do in java?

532


how can i use a nonsynchronized hashtable?

2099