What are the things we can do in Sub Class ?

Discussion in 'Object Oriented Concepts' started by vbraojava, Sep 11, 2008.

  1. vbraojava

    vbraojava New Member

    - A SubClass inherits all of the Public and Protected members of its Super Class, no matter what package the subclass is in.

    - We can use the inherited members as it is, or replace them, hide them, or supplement them with new members:

    - The inherited fields can be used directly, just like any other members of Class.

    - We can declare new fields in the SubClass that are not in the SuperClass. And also we can declare a field in the SubClass with the same name as the one in the SuperClass (means hiding).

    - We can declare new methods in the SubClass that are not in the SuperClass.And the inherited methods can be used directly as they are. And also we can write a new method in the SubClass that has the same signature as the one in the SuperClass, called Method Overriding.

    - We can invoke the constructor of the SuperClass.
     
  2. anneroberts

    anneroberts Member

    In the association the middle of two objects, An subclass will be those name provided for of the population that is inheriting from the superclass. In spite of the fact that it resonances a minimal drabber, keep in mind that its a All the more particular form of the superclass.
     

Share This Page