Abstraction or Data hiding refers to the act of representing essential features without including the background details or explanation.

Example: While driving a car, we only know the essential features of the car like gear handling, steering handling, use of clutch, accelerator, and brakes etc. but we do not get into internal details like wiring, engine/motor works etc.

Class car
/*Public interfaces*/
int get_gear_count(void);
int turn_left(void);
int turn_right(void);
int go_straight(void);
int set_speed(int kmh);
int get_speed(int kmh);
int do_break(void);
/*Private hidden members*/
  int steering_direction;
  int engine_speed;
  int break_value;
  int current_gear;

About our authors: Team EQA

You have viewed 1 page out of 62. Your C++ learning is 0.00% complete. Login to check your learning progress.