-2
  1. I want know where Collections (e.g. array lists)are is useful in real time web application development. I already know the properties of an array list, like duplicates allowed,insertion order is preserved etc.
  2. Where the sort method is useful(e.g. collections.sort()). We use sql queries to sort the data in ascending/descending order.
  3. How we realized that thread safety is required/not required.
manniL
  • 7,157
  • 7
  • 46
  • 72
PAWAN
  • 1
  • 1

1 Answers1

0

ArrayList

The class java.util.ArrayList provides resizable-array, which means that items can be added and removed from the list. It implements the List interface.

An ArrayList is a dynamic data structure so it can be used when there is no upper bound on the number of elements.

A simple Array in java is a static data structure, because the initial size of array cannot be changed, so it can be used only when the data has a known number of elements.

  1. For your second question you must refer here

  2. for Thread safety refer here

Next time before asking such a question try searching yourself. Feedback much appreciated.

Community
  • 1
  • 1
Mohit
  • 522
  • 4
  • 10