JShell in Java

The Java Shell or JShell is an interactive command line tool for learning the Java programming language and to test Java code. JShell is a Read-Evaluate-Print Loop (REPL), which evaluates declarations, statements, and expressions as they are typed and immediately shows the results. This way you don’t need to write…

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. Table of contents Java ScheduledThreadPoolExecutor Java ScheduledThreadPoolExecutor constructors Creating ScheduledThreadPoolExecutor instance using Executors factory methods Scheduling…

Continue reading

Java Executor Tutorial – Executor, ExecutorService, ScheduledExecutorService

In this Java executor tutorial you’ll learn how to use Executor, ExecutorService, ScheduledExecutorService and their thread pool implementations to effectively manage threads in a large scale application. Table of contents Java Executor API Java Executor interface Java ExecutorService interface Java ScheduledExecutorService interface Java Executor implementation classes Creating executors using Executors…

Continue reading