Learn to run multiple Callable tasks with ExecutorService.invokeAll() API and processing all the results returned from tasks in form…
Category: Java
How to Shutdown a Java ExecutorService
ExecutorService interface provides 3 methods shutdown(), shutdownNow() and awaitTermination() for controlling the termination of tasks submitted to executors. Learn how to…
What is ExecutorService in Java
Learn to use Java ExecutorService to execute a Runnable or Callable class in an asynchronous way. Also,…
Difference between sleep() and wait() in Java
1. Java sleep() and wait() – Discussion sleep() is a method which is used to pause…
Java Concurrency – Difference between yield() and join()
yield() method Theoretically, to ‘yield’ means to let go, to give up, to surrender. A yielding…
Difference between Runnable vs Thread in Java
1. Create Thread using Runnable Interface vs Thread class Let’s quickly check the java code…
Thread Priority in Java
In this post, we are going to discuss thread priorities in detail and the different types of…
Replace Multiple Consecutive Characters with Single Character in Java
This tutorial shows you how to replace multiple consecutive characters with single character. Consider we…
Autoboxing and Unboxing in Java
Autoboxing is an automatic conversion of a primitive type into its corresponding wrapper class object…
Linear Search in Java with Example
It is an algorithm that searches for an element one by one in an array,…