-3

If we can have 100% abstract class with all abstract methods that will work equivalent to Interface.Why we have interface and how it is better than 100% abstract class???

Keshav
  • 821
  • 2
  • 12
  • 33

1 Answers1

1

A class can only inherit from one abstract class, but it can implement as many interfaces as its developer wants to. That's why you should prefer interfaces over abstract classes, unless you have to provide an implementation of a method.

Andres
  • 10,561
  • 4
  • 45
  • 63