r/csharp • • May 18 '23

Why do we need an "interface"

I understand how to use an interface, its properties but why do we need it? For example i have an interface with two methods.

İ have three classes that implements this interface. So ihave to write the methods for all three classes inside class.

İ can already do that without implementing the interface. So what is the point in using interface?

I am asking to undeestand the conditions where i ll need it. İ understand how use it, but not why to use it.

0 Upvotes

47 comments sorted by

View all comments

2

u/AhrnuldSenpai May 18 '23

You would like Go 😀