Posts

Showing posts from May, 2022

Comparison Between Inheritance and Polymorphism

Image
Introduction What is Inheritance? Inheritance is the ability of a class to utilize the features and traits of another class. Inheritance consists of  two types of classes are involved Superclass and subclass: SubClass : A subclass is a class that utilizes the traits and characteristics of other classes. Superclass : Other classes use the characteristics of this class. Syntax : class ParentClass_Name                                                                                                                                             {      //methods and fields of ParentClass } class SubClass_Name extends   ParentCl...