Professional Documents
Culture Documents
OOPS
OOPS
Unmanageable Programs
Code Reusability not Optimum
Difficulty in Implementation
Object-Oriented Programming Language
using System;
• Declaration
• Constructors
Modifier Description
public The code is accessible for all classes
. private The code is only accessible within the same class
protected The code is accessible within the same class, or in a class that
is inherited from that class.
internal The code is only accessible within its own assembly, but not
from another assembly.
o We can incorporate the functionality of existing classes into
any other class just by inheriting the new class from the
existing class.
o The existing class is called the BASE class and the newly
created class is called the DERIVED class.
Inheritance
Enables you to
– Create a general class and then define specialized classes
that have access to the members of the general class
A derived (or child) class inherits from a base (or parent) class
The derived class inherits all the attributes and behaviour of the
base class.
The derived class may implement also its own attributes and
behavior.