List and ArrayList difference

Difference

  1. List is an interface and ArrayList is a class
  2. List cannot be instantiated but ArrayList can be instantiated. Means you cannot create an object of a List but you can create an object of an ArrayList.
  3. List provides faster manipulation of objects. ArrayList provides slower manipulation of objects as compared to List.
  4. List provides a list of objects that can be accessed by index numbers. ArrayList creates a dynamic array which can be extended when required.

Comments

Popular posts from this blog

Collections in Java

Exception Handling

OOPS Concept in Java