Java Abstract and Interface

In this article we will look into important topic Abstraction. Abstraction is one of the core concepts of OOP. Abstraction allows us to hide the implementation details provide simpler, high-level interface for interacting with system. We can achieve abstraction by using Abstract class or Interface. Introduction Abstract keyword is a non-access modifier in Java that … Read more

Java Serialization and Deserialization explained

Serialization and de-serialization are processes in Java (and in programming in general) that involve converting an object into a byte stream and vice versa. This is particularly useful when you need to transfer or store an object’s state, such as when sending it over a network or persisting it to a file. Java Serialization Serialization … Read more

What is String vs StringBuilder vs StringBuffer in Java

In Java, String, StringBuilder and StringBuffer are three different classes used for handling text data, but they have distinct characteristics and are used in different scenarios. Although they serve similar purposes, they have distinct characteristics that can significantly impact performance, memory usage, and thread safety. In this article we will explore these differences different scenarios. … Read more

In Java Association, Aggregation and Composition Explained

In Java, aggregation is a type of association between classes in which one class (the whole or container) contains a reference to another class (the part or component). Aggregation represents a “has-a” relationship, where one class contains objects of another class as part of its internal structure. It is a way to represent the relationship … Read more

Java exception handling mechanism in details

In Java, checked exceptions play a significant role in defining the contract and behavior of methods during inheritance. we will explore some key rules for using checked exceptions during inheritance, along with code examples in this article. Method Overriding is possible only if certain conditions are satisfied. These are a few of them. The argument … Read more

Java final keyword

One of the features of Java that is particularly important for programmers to understand is the “final” keyword. In Java, the final keyword is used to denote constants. It can be used with variables, methods, and classes. we’ll take a look at what the final keyword means for classes, methods, and variables. The “final” keyword … Read more

Java Volatile keyword

The Java volatile keyword is used to mark a Java variable as “being stored in main memory”, means that every read of a volatile variable will be read from the computer’s main memory, and not from the CPU registers, and that every write to a volatile variable will be written to main memory, and not … Read more

Java Transient Keyword

In the world of Java programming, developers often come across terms like “transient” when dealing with variables. These modifiers play a crucial role in determining the behavior and characteristics of variables in different scenarios. In this article, we will look into the concepts of transient, explore it for better understanding. Transient Keyword in Java In … Read more

Java Immutable Class

In this article, we will look how to create custom immutable class in Java. Immutable objects are those objects whose states cannot be changed. For example, you can change the state of an object by changing its attribute’s or field’s value. String is an example of an immutable class in Java. Other examples of immutable … Read more

What is exception handling in java

Exception handling is an essential part of any robust software application. In Java, an exception is an event that interrupts the normal flow of a program and can occur at runtime. It could be due to various reasons, such as incorrect input, lack of resources, or programming errors. Exception handling helps a program handle such … Read more