reading-notes

Inheritance and Interfaces

What Is Inheritance?

a mechanism in which one object acquires all the properties and behaviors of a parent object. It is an important part of OOPs.

What Is an Interface?

An interface declaration can contain method signatures, default methods, static methods and constant definitions. The only methods that have implementations are default and static methods.

What Is a Package?

A package in Java is used to group related classes. Think of it as a folder in a file directory . to keep things organized by placing related classes and interfaces into packages.

difference Inheritance vs Interface

The difference between inheritance and interface is that inheritance is to derive new classes from existing classes and interfaces is to implement abstract classes and multiple inheritance