java core

Your blog category

Builder Pattern

The Builder Pattern is a creational design pattern used to construct complex objects step by step. It allows you to produce different types and representations of an object using the same construction process. This pattern is particularly useful when dealing with objects that have multiple attributes or configuration parameters, especially when some of them are …

Builder Pattern Read More »

Abstract Factory Pattern

The Abstract Factory Pattern is a creational design pattern that provides an interface for creating families of related or dependent objects without specifying their concrete classes. It’s useful when you need to create multiple families of related objects or ensure that objects created by a factory are compatible and work together seamlessly. Important Features Abstract …

Abstract Factory Pattern Read More »

Singleton Pattern

The Singleton pattern is a design pattern that ensures a class has only one instance and provides a global point of access to it. It’s commonly used when you need exactly one object to coordinate actions across a system, like a configuration manager or a database connection pool. Important Features Single Instance: Restricts instantiation to …

Singleton Pattern Read More »

Introduction to Creational Patterns

Creational design patterns focus on object creation mechanisms, providing flexible and efficient ways to instantiate objects while abstracting the creation process. They address challenges like managing object initialization, controlling instantiation, and ensuring systems are loosely coupled. These patterns are particularly useful when the creation process is complex, needs to be reusable, or requires specific configurations. …

Introduction to Creational Patterns Read More »

Categories of Design Patterns

Design patterns are categorized into three main types: Creational, Structural, and Behavioral. Each category addresses different aspects of software design problems and provides templates for solving these problems. Here’s an overview of all design patterns within these categories along with simple use cases. Creational Patterns Creational patterns deal with object creation mechanisms, enhancing flexibility and …

Categories of Design Patterns Read More »

Introduction to Design patterns

Design patterns are reusable solutions to common software design problems, providing a structured approach to building robust, maintainable, and scalable systems. They capture best practices and proven techniques, allowing developers to solve recurring issues efficiently without reinventing the wheel. Originating from the work of Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides (the “Gang …

Introduction to Design patterns Read More »

Logger

The Logger class is part of the java.util.logging package in Java. It is used for logging messages for a specific system or application component. Loggers are typically named using hierarchical dot-separated names (e.g., com.bank.account). Commonly Used Methods Simple Logger Program Problem Statement: LotusJavaPrince has designed a banking system that performs fund transfers. If something goes …

Logger Read More »

Thread class and Multithreading

The Thread class in Java, part of the java.lang package, is used to create and manage threads for concurrent execution. It provides the foundation for multithreading in Java by allowing you to define and control threads directly. Important Concepts Definition: The Thread class extends Object and implements the Runnable interface, which means it has a …

Thread class and Multithreading Read More »

Throwable, Exception, and Error classes

Throwable, Exception, and Error Classes in Java In Java, exception handling is based on the hierarchy of classes that represent different types of exceptions and errors. The root of this hierarchy is the Throwable class, which is a superclass for all exceptions and errors. Understanding the structure and significance of Throwable, Exception, and Error classes …

Throwable, Exception, and Error classes Read More »

Scroll to Top