Adet Reviewer
Adet Reviewer
Types of Polymorphism:
MODULE 3: OBJECT-ORIENTED 1. Method Overriding (Runtime
PROGRAMMING (OOP) IN C# Polymorphism) – A subclass
4 Pillars of OOP provides a new implementation of a
method from its parent class.
1. Encapsulation: Restricts direct
access to object data. EXAMPLE:
class Animal
Encapsulation is implemented
{
using private fields and public
public virtual void MakeSound()
properties.
{
EXAMPLE: Console.WriteLine("Animal
makes a sound");
class Person
}
{ }
3. Controller
Components of MVC: • Acts as the middleman between
1. Model Model and View.
• Represents the data and the • Takes user input, processes it, and
business logic. interacts with the Model.