Java

Java Custom Exception – User Defined Exceptions

Custom Exceptions or User-Defined Exceptions are very common in Java applications. We can easily create custom exception classes for different use cases. What are the different types of Exceptions? In Java, there are two categories….

Java SPI (Service Provider Interface) and ServiceLoader

Java SPI (Service Provider Interface) is the mechanism to load services dynamically. We can implement Java SPI in our application by following the specific set of rules and load the services using the ServiceLoader class…..

java.util Package in Java

The java.util package is part of java.base module. This package contains the most important APIs and classes in Java. Contents of java.util Package Java util package contains the following classes and APIs: Collections Framework Concurrent….

TinyLog – Lightweight Java Logging Framework Tutorial

TinyLog is a simple and lightweight logging framework for Java. We can use tinylog with Java, Kotlin, Scala, and Android applications. Benefits of TinyLog Logging Framework Avoids boiler-plate code of Logger initialization. The Logger class….

Java synchronized Keyword, Synchronized Method and Block

Java synchronized keyword is used in multithreading to create a code block that can be executed by only one thread at a time. Why do we need Synchronization? When we have multiple threads working on….

Java this Keyword

What is ‘this’ Keyword in Java? Java this keyword returns a reference to the current Object. We can access object variable, call the method or constructor of the current object using this keyword. Java ‘this’….

Java try-catch Examples

Java try-catch block is used to handle exceptions in the program. The code in the try block is executed and if any exception occurs, catch block is used to process them. If the catch block….

Linked List Insert Delete Methods

Linked List Insert Methods Linked List insert methods allow us to insert a Node at a specific place. There are three insert methods based on the position where the new node is inserted. addLast addFirst….

Introduction to Linked List (Java implementation)

A linked list is a linear data structure that contains a sequence of elements such that each element has reference to the next element in the sequence. Each element in the linked list is called….

How to Find Length of a Linked List?

What is a Linked List? A linked list is a linear data structure used for storing collections of data Successive elements are connected by pointers The last element points to NULL Each element is a….

close
Generic selectors
Exact matches only
Search in title
Search in content
Search in posts
Search in pages