Skip to content

Instantly share code, notes, and snippets.

View vishnu-saini's full-sized avatar

Vishnu Saini vishnu-saini

View GitHub Profile

Concurrency

Concurrent applications also make optimal use of the processors. But concurrent applications are difficult to develop, maintain, and debug. To develop thread-safe, high-performance, and scalable applications, Java’s low-level threading capabilities are insufficient.

Concurrent collection classes

The java.util.concurrent package includes a number of additions to the Java Collections Framework. These are most easily categorized by the collection interfaces provided:

  • BlockingQueue defines a first-in-first-out data structure that blocks or times out when you attempt to add items to a full queue, or retrieve from an empty queue.

Java Inner Class

Java inner class is defined inside the body of another class. Java inner class can be declared private, public, protected, or with default access whereas an outer class can have only public or default access.

Java inner classes are divided into 4 categories

  • Static inner class
  • Non-static java inner class
  • Method local inner class
  • Anonymous inner class

Static inner class