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 8 optional

In this article we will look into the java optional that get introduce in Jdk 8. An optional is an class in java.util package and acts as container that can hold both empty and a non-null values. It was introduced as a way to help reduce the number of NullPointerExceptions that occur in Java code. … Read more

Java 8 default and static methods in Interface

In this article we will look into the enhancement done in Java 8 in respect to interface, Java 8 interface changes include static methods and default methods in interfaces. Introduction Traditionally Interfaces in java are actually contract. All method is by default abstract in nature.  A contract which says a class implementing interface must implement … Read more

Super keyword in java

In this article we will look into the  super keyword in java. The super keyword in Java play important role in the concept of inheritance. The super keyword in Java is a reference variable which is used to refer immediate parent class object. Whenever you create the instance of subclass, an instance of parent class … Read more

Java8 lambda expression

In this article, we will discuss one of the important feature introduced in Java 1.8 version i.e. Lambda Expression. Java 8 introduced lambda expression to move toward functional programming. A lambda expression is an anonymous function that doesn’t have a name and doesn’t belong to any class. They can be passed as a parameter to … Read more

Java 8 – Functional Interface with examples

In this article we will look into Java 8 functional interfaces, An interface which contains only one abstract method is called as Functional interface. Rules for Functional Interface : Functional Interface can have maximum of only one abstract method In short, it is called as Single Abstract Method i.e.; SAM In addition to one abstract … 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

Collection in Java

Collection interface is a member of the Java Collections framework. A collection represents a group of objects, known as its elements. Some collections allow duplicate elements and others do not. Some are ordered and others unordered. The Java collections framework provides various data structures and algorithms that can be used directly. Java Collections is a … 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