BUSCA

Links Patrocinados



Buscar por Título
   A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z


Importance Of Baseclasses And Superclasses
(Anonymous)

Publicidade
A superClass is a class from which you drive the basic functionality needed for each and every task.
It's a building block for each of the other base classes and derived classes. For example System.Object is the ultimate superclass of all classes in the .NET Framework; it is the root of the type hierarchy.

A base class is the one which is derived from(by default) from superclass but is the base for other derived classes . Derived classes are the one which augment the functionality or the basic idea provided by the base classes and enhance its features but they basically get the basic ideas from the base class.

Without base class features inclusion the derived classes would not have been possible as a base class without the superclass.Though in apparantly it appears that everything is provided by derived classes as they are expertized at augmenting the features of basic classses.

It gives you basic idea from where it can be augmented further. So the basic idea is derived possiblility of existance of derived classes becomes nil in the absence of base classes.
Overriding
Once you start inheriting functionality from a base class, you might find that the generic method you wrote in the base class only performs part of what you need in the inheriting class. Instead of creating a whole new method, with a new name, to perform the full functionality that you want, you can override the base class' method in this new class.
When you override, you have the option of completely overriding the base class' method, or you can write some code to do something in the inheriting class and then call the base class' method. It is important that you when you override you still use the same contract, (the parameters and return type), of the original method. You may also choose to call the base class' method first, and then write additional code after the base class' method has finished executing.
Inherit From a Base Class
Inheritance gives you the ability to use all of the properties and methods from one class within another class. Instead of having to copy and paste code from one class to another, you use the keyword Inherits to get the functionality from the base class.


Conclusion:

Just as we inherit freely from the base class/Superclass we should never neglect their existance.Doing so can put up some exceptions which becomes difficult to handle later.



Resumos Relacionados


- A Guest Lecturer

- A Studeent And The Master

- Pride And Prejudice

- Self-confidence...........

- Rich Dad Poor Dad



Passei.com.br | Biografias

FACEBOOK


PUBLICIDADE




encyclopedia