What is interface or benefit of interface in term of oop?
Answer Posted / Salman Husain
An interface in object-oriented programming (OOP) defines a contract or blueprint for a set of methods that a class must implement. Interfaces allow for polymorphism, promoting loose coupling between objects, and making your code more modular, flexible, and reusable. By using interfaces, you can define a common behavior for multiple classes without having them inherit from the same base class.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers