Loading...
Loading...
Loading Curriculum...
Loading Subject...
Loading Topic...
Loading Lesson...
Loading Lab...
Abstraction is the process of hiding internal details and showing only the essential features of an object. It focuses on WHAT an object does instead of HOW it does it.
class Shape {
public:
virtual void draw() = 0; // Pure virtual function
};
class Circle : public Shape {
public:
void draw() override { /* Drawing logic */ }
};A class with at least one pure virtual function becomes "Abstract". You cannot instantiate it directly.
Reduces complexity by hiding the nitty-gritty details from the user.
Protects the internal state by only exposing necessary methods.
Think of a Car. You know how to use the steering wheel and pedals (Interface), but you don't need to know exactly how the engine works (Implementation) to drive it.