Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Difference between array and arraylist.

Answer Posted / prem

Array:
It is mainly used to store and retrive similar datatype
elements.
It is a limited storage.
So it's size not growable and shrinkable.
It will create array out of bound exception while we adding
more elements in an array after exceeding array size..
While we remove elements from array,the array size will be
same.size will not get reduce.

ArrayList:
It is a class.
It is a collection.
It is used to store different datatype objects.
It is growable and shirnkable.
So whenever we add elements in an ArrayList the size of
ArrayList will grow..While we remove element from an
ArrayList the size of ArrayList will get reduce..
So memory will get save..

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you use substring in java?

1124


Where import statement is used in a java program?

1118


Explain how to force the garbage collection in java.

958


What is prime number in java?

984


What is time complexity algorithm?

1039


Explain spliterator in java8?

1040


What are advantages of exception handling in java?

1012


Explain abstract class in java?

1055


What is the different types of functions?

1050


What is void data type?

977


a thread is runnable, how does that work? : Java thread

998


What is nextint java?

1045


Does isempty check for null?

1011


who can i handle multiple client in RMI

1881


What is increment in java?

956