Inheritance:Inheritance is a mechanism in Java where one class inherits properties and behaviors from another class. It allows for code reuse and promotes hierarchical organization of classes.
Method Overriding: Method overriding occurs when a subclass provides its own implementation of a method that is already defined in its superclass. This allows for customization and specialization of behavior.
toString() method:The toString() method is a method defined in the Object class that returns a string representation of an object. It is commonly overridden in subclasses to provide meaningful information about the object's state.