Object-Oriented Programming:
Inheritance
- Classes may derive from existing classes.
- Derive - Specialize the "parent" class.
- "is a" relationship
Polymorphism
- Method Overriding - Modifying a method in the derived class
- Implemented w/ Virtual & Overridden methods
Class Book {
public virtual double Discount();
}
Class Fiction: Book {
public override double Discount(){
base.Discount();
}
}
Encapsulation
- Each class has a single area of responsibility
- Most of the internals of the class are private, with a few well-defined properties & methods that are public.