-1

As we all know about abstraction and encapsulation fundamental that help to build robust and loosely coupled architecture.

When we start designing classes we need to keep in mind the specialized attributes and based on that structure need to build.Usually we go with interfaces or abstract classes for creating a foundation of architecture.

I am confused here with interfaces, weather they are lied under abstraction?

Why they said program to interface, not implementation.

Thanks in advance for clarifying.

Amit Soni
  • 3,216
  • 6
  • 31
  • 50
  • 2
    Possible duplicate of [What does it mean to "program to an interface"?](http://stackoverflow.com/questions/383947/what-does-it-mean-to-program-to-an-interface) – jaco0646 May 12 '16 at 13:43

1 Answers1

0

If we talk about abstraction it is like hiding the implementation details from user. Like user need to only use the class or function that is abstracted.

If we use abstract class along with abstract method. We have to use all the abstract method (if any) of that abstract class while inheriting that class, But if we talk about interfaces it is not like that.

interface is to reduce redundant data to the inherited class. If we use interface then we can implement any feature or function of the class and write out the definition accordingly.

In short interface is not abstraction.