What are SOLID principles?

SOLID is an acronym of below five object-oriented design principles. S – Single Responsibility O – Open Closed L – Liskov Substitution I – Interface Segregation D – Dependency Inversion Single Responsibility Principle Every entity (class, method, or module) should have a single responsibility. In other words, every entity must have a single reason to …

Why Strings are Immutable in Java?

Before understanding why strings are immutable in java, we need to think about why do we make something immutable? Immutable means once created we cannot change it. The one reason that we can think of making anything immutable is synchronization when it’s shared. It’s the same reason that strings are immutable. In Java, String objects …

Difference Between Aggregation and Composition

Aggregation and Composition are basically the concepts about how to manage objects Aggregation Aggregation uses loose coupling, which means that it does not hold the actual object in the class. Instead, the object is being passed via getter or setter function. It gives the benefit that when the object of the parent class dies then the …