0

What exactly is abstraction whether it is hiding unwanted information or the entire implementation.

Two examples .hpp

class {
int do_something();
}

by not exposing the actual code inside it.

or like calling more private functions and just exposing the outer function.

int do_something() {
  do_something_private(); 
  do_some_otherthing_private();
}
Cool Boy
  • 1
  • 2
  • Abstraction in OOP is the same as in reallife: You can have a `Vehicle`, specifically a `Car` and you can have an `Electric_Car` and you can have a `Lexus`. – Daniel W. Jun 28 '21 at 10:58
  • https://softwareengineering.stackexchange.com/questions/253090/why-are-inheritance-encapsulation-and-polymorphism-not-the-pillars-of-oop – Daniel W. Jun 28 '21 at 10:59

2 Answers2

0

In simple words abstraction is data hiding. We don't want the end user to know what's an integer indexNo or float serialId so we just encapsulate it with a class and give it as a simple variable name like student.rollNumber or employee.empId.

0

Abstraction is a means of hiding details in order to simplify an interface.

So, using a car as an example, all of the controls in a car are abstractions. This allows you to operate a vehicle without understanding the underlying details of the steering, acceleration, or deceleration systems.

A good abstraction is one that standardizes an interface broadly, across multiple instances of a similar problem. A great abstraction can change an industry.

The modern steering wheel, brake pedal, and gas pedal are all examples of great abstractions. Car steering initially looked more like bicycle steering. And both brakes and throttles were operated by hand. But the abstractions we use today were so powerful, they swept the industry.

Refer to this thread for more detail :-link

Syed Ahmad
  • 82
  • 3