You are on page 1of 1

OOP pillars:

Encapsulation -> is used to prevent alteration of code (data)


accidentally from the outside of functions.by defining the class fields with
properties we can protect the data from accidental corruption.
Inheritance -> allows you to define a base class that provides specific
functionality (data and behavior) and to define derived classes that either inherit
or override that functionality.
Polymorphism -> is the ability of an object to take on many forms
Static -> the ability to a class to have multiple implementations
with the same name // Add(int a) and Add(int a, int b)
Dynamic-> circle= new Circle() circle.Area();
square= new Square() square.Area();

Abstract class -> To be used as a base class, can not be instantiated on its
own. Can have abstract and non-abstract methods/properties.
Abstract methods -> Abstract method does not have implementation in Abstract
class. Child class must implement all abstract methods/properties with override
keyword.
Virtual methods -> Must declare a method body in abstract class. Can be
overriden in child class.

Interface -> name starts with "I". Methods/properties in Interface can not have
implementation. Child class can derive from multiple interfaces.

Delegate -> create variables that points to methods.

You might also like