Professional Documents
Culture Documents
PF101 Week-10 Debugging and Tracing
PF101 Week-10 Debugging and Tracing
Classes
• A class groups different functions, methods,
variables, and properties, which are called its
members.
• A class encapsulates the members, which
can be accessed by an instance of the class,
called an object. Classes are the building
blocks of object-oriented programming
languages.
Abstract Class
• If classes share common
functionality you can group this in a
base or abstract class. Abstract
classes can contain partial or no
implementation at all and allow the
derived type to override the base
implementation.
A sub type can then inherit this abstract class as shown below:
Car will inherit all of the declared types within vehicle, but
can only access them based upon the underlying access
modifier.
Creating Classes
• Classes provide a way of creating your own
types within the .NET framework. Within a
class definition you may include the
following:
• Fields
• Properties
• Methods
• Constructors
• Events
Object
• Object is a self-contained component that
contains properties and methods needed to
make a certain type of data useful.