# data[].attributes.body
Advantages:

Supports extensibility and flexibility in code.

Makes it easy to introduce new classes with minimal changes to existing code.

# data[].attributes.body
Compile-time vs Runtime:

At compile-time, the reference type determines which methods are available.

At runtime, the actual object type determines which method is executed.

# data[].attributes.body
Inheritance enables polymorphism by allowing subclasses to override superclass methods.

# data[].attributes.body
Polymorphism means “many forms.” In Java, it refers to the ability to call the same method on different types of objects and get different behaviors.

# data[].attributes.body
super():

Used to explicitly call a constructor from the superclass.

If not called, Java inserts a default super() call to the no-arg constructor of the superclass.

If the superclass does not have a no-arg constructor, the subclass must explicitly call a constructor with parameters.

# data[].attributes.body
Constructors are not inherited:

Each class must define its own constructors, even if it's a subclass.

# data[].attributes.body
Inheritance Implication:

A subclass can access public and protected members of its superclass, but not private members.

# data[].attributes.body
private:

Not accessible outside the class, including from subclasses.

# data[].attributes.body
default (no modifier):

Accessible only within the same package.

# data[].attributes.body
protected:

Accessible within the same package and also from subclasses (even in different packages).

# data[].attributes.body
public:

Members declared public are accessible from anywhere, including outside the package.

# data[].attributes.body
Rules:

The method in the subclass must have the same name, return type, and parameters as the method in the superclass.

The method must be inheritable, i.e., not marked as private or final.

# data[].attributes.body
Purpose: It allows a subclass to modify or extend the behavior of a method inherited from its parent class.

# data[].attributes.body
Method overriding occurs when a subclass provides a specific implementation of a method that is already defined in its superclass.

# data[].attributes.body
Multiple classes inherit from the same superclass.

# data[].attributes.body
A class inherits from another, which in turn inherits from a third.

# data[].attributes.body
One class inherits from another.

# data[].attributes.body
Makes updating code easier.

# data[].attributes.body
Allows adding new functionalities without modifying existing code.

# data[].attributes.body
Avoids code duplication.

# data[].attributes.body
Reference to the superclass, used to access its methods or constructors.

# data[].attributes.body
Java keyword to indicate inheritance.

# data[].attributes.body
The class that inherits from another and can add or modify behavior.

# data[].attributes.body
The class from which attributes and methods are inherited.

# data[].attributes.headline
Inheritance how it works in our daily life?

# data[].attributes.subject
Inheritance how it works in our daily life?

# data[].attributes.body
Inheritance is a programming language mechanism that allows us to create objects from definitions provided in multiple, inter-related classes.

# data[].attributes.body
In this case A dog class inheretits from Animal

# data[].attributes.body
A mechanism that allows one class to derive from another.

Reuses code and promotes hierarchical organization.