Posts

Unit 3 - CSE B

Image
  Java Inheritance   ( ‘ IS-A ’ relationship)   It is a mechanism in which one object acquires all the properties and behaviors of a parent object.    Why use inheritance? For  Method Overriding  (so  runtime polymorphism  can be achieved). For Code Reusability.   Terms used in Inheritance Super Class/ Parent Class/Base Class:  Superclass is the class from where a subclass inherits the features. Sub Class/ Child Class / Derived Class:  Subclass is a class which inherits the other class. It is also called a derived class, extended class, or child class.   Ex:- Class A {   } Class B extends A {   }   class A {                  void hello()                 {  ...