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

When do you call copy constructor?

554


What are exception handling keywords in java?

604


What is lazy initialization in java?

550


What does percent mean in java?

589


What is main in java?

506






What is executor memory?

520


What 4 doubled?

544


What are alternatives to java serialization?

599


What is a parameter in matrices?

541


Can we override data members in java?

623


What is the difference between object oriented programming language and object based programming language?

552


How to reverse a string in java?

522


Describe the various concepts related to object oriented programming (oop).

584


When do I need to use reflection feature in java?

622


How do you declare an array in java?

514