Showing posts with label Collections_FrameWork. Show all posts
Showing posts with label Collections_FrameWork. Show all posts

Sep 3, 2022

Collections_FrameWork_Part2

Concurrent Collections (1.5)

Need for Concurrent Collections

  • Tradition Collection Object (Like ArrayList, HashMapEtc) can be accessed by Multiple Threads simultaneously and there May be a Chance of Data Inconsistency Problems and Hence these are Not Thread Safe.
  • Already existing Thread Safe Collections (Vector, Hashtable, synchronizedList(), synchronizedSet(), synchronizedMap() ) Performance wise Not Upto the Mark.
  • Because for Every Operation Even for Read Operation Also Total Collection will be loaded by Only One Thread at a Time and it Increases waiting Time of Threads.

Collections_FrameWork_Part1


Array

  • An Array is an Indexed Collection of Fixed Number of Homogeneous Data Elements.
  • The Main Advantage of Arrays is we can Represent Multiple Values by using a Single Variable so that the Readability of the Code will be Improved.

You may also like

Kubernetes Microservices
Python AI/ML
Spring Framework Spring Boot
Core Java Java Coding Question
Maven AWS