Pillars of Object Oriented Programming Flashcards
What is Object Oriented Programming?
A way of organising software design around real world objects
How does it do this?
By using classes and objects
What is a class?
A class is like a blue print for real world object that is made up of it’s own properties like data and functionality.
What is an object?
This is an instance of a class
What is the main benefit of OOP?
It promotes code reusability
What are the 4 Pillars of OOP?
Abstraction
Encapsulation
Inheritance
Polymorphism
What is Abstraction?
Abstraction is about only showing what is necessary
What is Encapsulation?
Encapsulation is about hiding complexity
What is Inheritance?
Inheritance allows an object to inherit properties of it’s parent
.What is Polymorphism?
Polymorphism allows objects to occur in many forms
ie Animal base class, with Dog, Cow, Cat etc.. all having makeNoise()
How is Abstraction achieved in C#
- Encapsulation
- Abstract classes
- Interfaces
How is Encapsulation achieved in C#
Using access modifiers like public, private etc…
How is Inheritance achieved in C#
By creating derived classes or multiple interfaces
How is Polymorphism achieved in C#
Method and operator overloading