Difference between array and arraylist.

Answer Posted / vk

Array is a collection of similar data types,ArrayList is not you can store any type of data types in AL.ArrayList will autometically increase 50% of the size which we allocated previously, but Array wasn't.

ArrayList al= new ArrayList();
al.add("a");
al.add(10);

both can be accepted in ArrayList.

Is This Answer Correct ?    4 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which sort is best in java?

535


How does arrays sort work in java?

604


What is the difference between serializable and externalizable interface?

570


Write an algorithm program in java for the following question.. 1) S is a set of integers.X is an integer obtained by sum of two digits in S. Write logic for whether or not the X is from the S. The time of algorithm should not exceed o(n logn).

1609


Why main() method is public, static and void in java ?

600






Can we override private constructor in java?

509


State the difference between creating string as new () and literal.

528


What is OOP Language?

632


Why parameters should be passed by reference?

504


How do you sort objects in java?

522


What does business logic mean?

510


Does A Class Inherit The Constructors Of Its Superclass?

538


Why java is call by value?

552


Is empty in java?

582


How can you add and remove nodes in jtree?

617