Static Import in Java

With Java static import feature, which was added in Java 5, you can access static members (fields and methods defined as public static) of a class without qualifying them with class name. How to use static import in Java Generally if you need to access any static member (static field…

Continue reading

Java ScheduledThreadPoolExecutor – Scheduling With ExecutorService

ScheduledThreadPoolExecutor in Java adds functionality to schedule commands to run after a given delay, or to execute periodically. Since ScheduledThreadPoolExecutor is an ExecutorService so it uses thread from a thread pool to execute tasks. Java ScheduledThreadPoolExecutor ScheduledThreadPoolExecutor class is part of Java Executor framework with in the Java concurrent API.…

Continue reading

Java Executor Tutorial – Executor, ExecutorService, ScheduledExecutorService

In this Java executor tutorial we’ll learn how to use Executor, ExecutorService, ScheduledExecutorService and their thread pool implementations to effectively manage threads in a large scale application. Java Executor API While using Java multi-threading for creating thread, there is a close connection between the task being done by a new…

Continue reading

ConcurrentLinkedDeque in Java

ConcurrentLinkedDeque in Java implements Deque interface and is part of java.util.concurrent package. ConcurrentLinkedDeque in Java is an unbounded concurrent deque which is thread-safe. It stores its elements as linked nodes where each node stores a reference to both previous and next nodes. How ConcurrentLinkedDeque differs from the blocking Deque implementations…

Continue reading

ConcurrentLinkedQueue in Java

ConcurrentLinkedQueue in Java implements Queue interface and is part of java.util.concurrent package. ConcurrentLinkedQueue in Java is an unbounded queue which is thread-safe. It stores its elements as linked nodes where each node stores a reference to the next node. How ConcurrentLinkedQueue differs from the BlockingQueue implementations like ArrayBlockingQueue, PriorityBlockingQueue is…

Continue reading