Difference between HashMap and LinkedHashMap in Java

Hey everyone, welcome back to the blog post! Today, we’re comparing two important implementations of the Map interface in Java—HashMap and LinkedHashMap. While they share many similarities, there are a few key differences when it comes to ordering and performance. Let’s dive into the details and see some examples to understand when you should use …

Difference between HashMap and LinkedHashMap in Java Read More »

Difference between ArrayList and HashSet in Java

Hey everyone, welcome back to my blog! In today’s blog post, we’ll be comparing two popular collections in Java—ArrayList and HashSet. While both are used to store collections of objects, they behave differently in terms of ordering, performance, and duplicate handling. Let’s dive into the differences and see some examples to clarify these concepts! Difference …

Difference between ArrayList and HashSet in Java Read More »

HashSet vs LinkedHashSet vs TreeSet in Java

Hey everyone, welcome back to my blog! In today’s blog post, we’ll be comparing three important implementations of the Set interface in Java—HashSet, LinkedHashSet, and TreeSet. While all three are used to store unique elements, they behave differently in terms of performance, ordering, and structure. Let’s dive into the differences and see some examples in …

HashSet vs LinkedHashSet vs TreeSet in Java Read More »

Difference between HashSet and TreeSet in Java

Hey everyone, welcome back to the blog! In today’s blog post, we’ll discuss two important implementations of the Set interface in Java—HashSet and TreeSet. Both are used to store unique elements, but they have different behaviors when it comes to ordering, performance, and how they store data. Let’s dive into the differences and look at …

Difference between HashSet and TreeSet in Java Read More »

Difference Between ArrayList and LinkedList

Hey everyone, welcome back to the blog! Today, we’re going to compare two commonly used list implementations in Java—ArrayList and LinkedList. While they both implement the List interface, they behave quite differently under the hood. So, let’s break down their differences and see when you should use one over the other.” Difference Between ArrayList and …

Difference Between ArrayList and LinkedList Read More »

Spring Boot + JUnit 5 + Mockito: Unit Testing Service Layer

Introduction In this tutorial, we will focus on unit testing the service layer of a Spring Boot application using JUnit 5 and Mockito. Unit testing is the process of testing individual units or components of an application in isolation. This ensures that each unit behaves correctly in different scenarios. JUnit 5 is a popular testing framework …

Spring Boot + JUnit 5 + Mockito: Unit Testing Service Layer Read More »

Spring Boot CRUD Example with MongoDB: CRUD REST API Step-By-Step Guide

In this tutorial, we will build a Spring Boot CRUD (Create, Read, Update, Delete) application using MongoDB. We will manage a Todo entity with fields: id, title, description, status, and createDate. We will use Java record for the DTO and follow best practices by keeping the conversion logic in the service layer. We will develop …

Spring Boot CRUD Example with MongoDB: CRUD REST API Step-By-Step Guide Read More »

Spring Boot CRUD Example with MariaDB

In this tutorial, we will build a Spring Boot CRUD (Create, Read, Update, Delete) application using MariaDB. We will develop CRUD RESTful web services for creating, reading, updating, and deleting todos. Spring Boot Three-Layer Architecture +———–+ +—————–+ | | | Controller Layer| | Postman +—–>+ (Handles HTTP | | (Client) | | requests and | …

Spring Boot CRUD Example with MariaDB Read More »

Spring Boot CRUD Example with MS SQL Server: CRUD REST API Step-By-Step Guide

In this tutorial, we will build a Spring Boot CRUD (Create, Read, Update, Delete) application using MS SQL Server. We will build CRUD RESTful web services for creating, reading, updating, and deleting products. Spring Boot Three-Layer Architecture +———–+ +—————–+ | | | Controller Layer| | Postman +—–>+ (Handles HTTP | | (Client) | | requests …

Spring Boot CRUD Example with MS SQL Server: CRUD REST API Step-By-Step Guide Read More »

Spring Boot CRUD Example with Oracle Database: CRUD REST API Step-By-Step Guide

In this tutorial, we will build a Spring Boot CRUD (Create, Read, Update, Delete) application using the Oracle Database. Spring Boot Three-Layer Architecture +———–+ +—————–+ | | | Controller Layer| | Postman +—–>+ (Handles HTTP | | (Client) | | requests and | +———–+ | responses) | +——–+——–+ | v +——–+——–+ | Service Layer | …

Spring Boot CRUD Example with Oracle Database: CRUD REST API Step-By-Step Guide Read More »

Spring Boot CRUD Example with PostgreSQL: Step-by-Step Guide

In this tutorial, we will build a Spring Boot CRUD (Create, Read, Update, Delete) application using PostgreSQL as the database. The application will manage a Product entity with fields: id, name, description, and price. We will use Java record for the DTO (Data Transfer Object) and follow best practices such as keeping the conversion logic …

Spring Boot CRUD Example with PostgreSQL: Step-by-Step Guide Read More »

Spring Boot CRUD Example with H2 Database: Step-by-Step Guide

In this tutorial, you’ll learn how to build a Spring Boot CRUD (Create, Read, Update, Delete) application using the H2 in-memory database. We will use Java record for the DTO (Data Transfer Object) and follow best practices by keeping the conversion logic in the service layer. What You’ll Learn: Setting up a Spring Boot project …

Spring Boot CRUD Example with H2 Database: Step-by-Step Guide Read More »

Spring Boot CRUD REST API with MySQL and Java Record DTO: Step-by-Step Guide

In this tutorial, we will create a Spring Boot CRUD (Create, Read, Update, Delete) application using MySQL as the database. We will use Java record for the DTO (Data Transfer Object) to transfer data between the client and server. What You’ll Learn: Setting up a Spring Boot project. Configuring MySQL for persistence. Implementing CRUD operations …

Spring Boot CRUD REST API with MySQL and Java Record DTO: Step-by-Step Guide Read More »

Python Program to Use Multiple Except Blocks

Introduction In Python, you can use multiple except blocks to handle different types of exceptions separately. This allows your program to respond appropriately to various errors that might occur during execution. Each except block catches a specific type of exception, enabling you to provide tailored error messages or handle the errors in different ways. This …

Python Program to Use Multiple Except Blocks Read More »

Python Program to Raise Custom Exceptions

Introduction In Python, you can raise custom exceptions to handle specific situations in your program that aren’t covered by the built-in exceptions. Custom exceptions allow you to define and manage errors specific to your application’s logic. This is done by creating a new exception class that inherits from Python’s built-in Exception class or one of …

Python Program to Raise Custom Exceptions Read More »

Python Program to Implement Try, Except, and Finally Blocks

Introduction In Python, the try, except, and finally blocks are used for exception handling. These blocks allow you to handle errors gracefully without crashing your program. The try block contains code that might raise an exception, the except block handles specific exceptions that might occur, and the finally block contains code that will execute no …

Python Program to Implement Try, Except, and Finally Blocks Read More »

Python Program to Handle File Not Found Exception

Introduction In Python, a FileNotFoundError occurs when an attempt is made to open a file that does not exist or is inaccessible. This exception can be handled using a try-except block, allowing the program to manage the error gracefully instead of crashing. This tutorial will guide you through creating a Python program that demonstrates how …

Python Program to Handle File Not Found Exception Read More »

Python Program to Handle Division by Zero Exception

Introduction In programming, exceptions are errors that occur during the execution of a program. One common exception is the ZeroDivisionError, which occurs when a number is divided by zero. To handle such exceptions gracefully, Python provides a try-except block, which allows you to manage errors and prevent your program from crashing unexpectedly. This tutorial will …

Python Program to Handle Division by Zero Exception Read More »

Python Program to Implement Abstraction

Introduction Abstraction is a fundamental concept in object-oriented programming (OOP) that focuses on hiding the implementation details and showing only the essential features of an object. This allows the user to interact with the object at a higher level without needing to understand the complexity of its inner workings. In Python, abstraction is typically implemented …

Python Program to Implement Abstraction Read More »

Python Program to Implement Encapsulation

Introduction Encapsulation is one of the fundamental concepts in object-oriented programming (OOP). It refers to the bundling of data (attributes) and methods (functions) that operate on the data into a single unit, or class. Encapsulation restricts direct access to some of an object’s components, which is a means of preventing unintended interference and misuse of …

Python Program to Implement Encapsulation Read More »

Python Program to Implement Polymorphism

Introduction Polymorphism is a key concept in object-oriented programming that allows objects of different classes to be treated as objects of a common superclass. It enables methods to be used in different ways based on the object that is invoking them. Polymorphism allows for the design of flexible and reusable code because the same method …

Python Program to Implement Polymorphism Read More »

Python Program to Implement Multiple Inheritance

Introduction Multiple inheritance is a feature of object-oriented programming where a class can inherit attributes and methods from more than one parent class. This allows a child class to combine the functionality of multiple parent classes. However, multiple inheritance can also lead to complexity, especially when different parent classes have methods with the same name. …

Python Program to Implement Multiple Inheritance Read More »

Scroll to Top