Base and Derived Class Constructor

As derived class inherits all the base class members, hence derived class objects executes the base class constructor. Base class constructor is not inherited by derived class constructor, however derived class constructor can call base class constructor. Points to Remember: When creating the derived class object the base class constructor is called first and then the derived class constructor is called. Example: Check on Inheritance in Java Topic.

Continue reading »

Inheritance in Java

Inheritance is an object-oriented programming technique. If you need a class similar to previous one with new additional features, java allows you to use the members of the existing class and add some more features to the new class. It is done by inheritance. The class which you derive is super class, base class or parent class. The class which is derived is sub class, derived class, child class. How to create Derived class, Syntax for creating derived class, class sub_class_name extens base_class_name { }…

Continue reading »