Why does "interface have no implementation"? - C# -
i have been reading code theory related multiple inheritance , interfaces. said in places interface class without implementation.
1) utilize of not having implemented methods/functions in interface? back upwards multiple implementations of same method in different classes inherit interface?
2) of code samples out there seem show void interface methods. interface functions/methods void?
to question 1: yes, 1 reason utilize interfaces. interfaces used api component. actual implementation can unknown consumer, supporting loose coupling , testability through unit tests.
regarding question 2: no, interface methods can have same method signatures class methods.
c# interface implementation
No comments:
Post a Comment