ArrayList (and most other List implementations) are easier to handle, since they grow on demand and don't require you to reallocate anything by hand.
Additionally they cooperate better with Generics than simple arrays do.
You should really google for a tutorial on the Collections framework and get to learn and love to power.
> When we have arrays in java, why did they provide
> arraylist? What is the basic advantage of ArrayList
> over Array?
>
> Thanks in advance
Look at the API that would answer your question. All the functionality available for Arraylist is it available for arrays as well.
It is very similar to asking why have String class when you can have an array of chars.
Sun is just trying to make your life easy
> When we have arrays in java, why did they provide
> arraylist? What is the basic advantage of ArrayList
> over Array?
Arrays are for storage. ArrayList provides functions/API that you don't get with just an Array. So it's more than storage. With ArrayList you get storage and built in functionality with it. ArrayLists of course use arrays under the hood to store data.