progressdll
Programmer
why use interfaces?
Trying to understand C#, i came across interfaces.
But i don't grasp to idea.
First, what do i know about them.
in an interface you describe methods. But do not implement them.
Then when you create a new class. You use the interface to inherit
it in the new class.
But why would you not create a new class and describe and implement
the methods there. You need to write the code for the methods anyway
because there is no code in the interface. What would be the point
in using them?
Joeri
Trying to understand C#, i came across interfaces.
But i don't grasp to idea.
First, what do i know about them.
in an interface you describe methods. But do not implement them.
Then when you create a new class. You use the interface to inherit
it in the new class.
But why would you not create a new class and describe and implement
the methods there. You need to write the code for the methods anyway
because there is no code in the interface. What would be the point
in using them?
Joeri