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 is difference between classpath and path variables in java?

660


What is lastindexof in java?

636


What is bubble sorting in java?

684


What is the purpose of tostring() method in java?

646


how is final different from finally and finalize in java?

689






Can we define private and protected modifiers for variables in interfaces?

684


What is serial version uid and its importance in java?

684


Difference between comparator and comparable in java?

703


How to write custom exception in java?

695


Why Java is not pure Object Oriented language?

749


What is an accessor?

1179


Is boolean a data type in java?

620


how to write a program for sending mails between client and server

1658


Define an abstract class with reference to java.

655


Which is better singleton or static class?

595