In this comprehensive guide, we will learn about How Java Thread interrupt works and the relevance of interrupt(), interrupted(), and the InterruptedException. What is Java Thread Interrupt? This is a process in which a Thread A can ask another Thread B to stop its execution using the below method. Obviously to call the interrupt method …
How to solve the Producer-Consumer problem program in java
Today we will learn about the most famous java programming interview question – The Producer consumer program. Even though there exist a lot of implementation of this program on the internet here I will try to provide a step-by-step guide towards the solution. Lets understand the problem first Understanding the Problem statement In the Producer-consumer …
How to use the Java Thread Join method with example
Today we will learn about the Java Thread join method and its different overloaded versions with full explanation using various scenarios. As we all know, working on a multi-threaded environment is a tedious task and the execution order of thread is unpredictable but important for thread synchronization. What is Thread.join() method? Thread.join() method imposes current …
3 Unique ways to make Java Database Connection
Today we will learn about the Java Database connection and several other ways to connect a Java application with DB. At the start of our career, the first API we encounter for database connection is JDBC API aka Java DataBase Connectivity API. In the beginning, we learn about Drivers, DriverManager, Connection and etc. All this …
How to use Java try with resources for efficient program
Java 7 introduces Java Try with Resources as an upgrade of the Normal try-catch block with several extra features. It was introduced by Oracle to implement Automatic resource management to effectively manage the closure and usage of resources. What is a resource? As I have already mentioned in one of my previous blogs on the …
How to add Eclipse resource folder and files
In this blog, we will learn about resource folder in eclipse JAVA project and will see addition, deletion and access of these files and folders. In the previous blog, I have explained How to pass arguments to JAVA’s main method in eclipse. What is a resource? A JAVA class works on many types of files …
Basic introduction of Apache Kafka and its entities
Today we will look into a basic introduction of Apache Kafka and its various entities and terminologies. Apache Kafka is a distributed messaging system that follows the publisher-subscriber model. A messaging system facilitates the transfer of data from one application to another. Hence this makes application to focus more on their data and functionalities instead …
How to Pass Arguments in JAVA main method in eclipse
In this article, we will learn about How to pass an argument in JAVA main method while working with eclipse IDE. In the previous eclipse tutorial blog, I have discussed about JAVA call stack analysis and today we will discuss about eclipse run configurations. As a JAVA beginner, the first program that we usually make …