Good day to all.
The task to understand the interfaces. I have an interface
interface ICheturehugolMain { int x { get; set; } int y { get; set; } int width { get; set; } int hight { get; set; } void Draw(Graphics g); } And also 3 classes inherited from this interface, say, one of them
class CheturehugolVrashatelnoe : ICheturehugolMain { public int x { get; set; } public int y { get; set; } public int width { get; set; } public int hight { get; set; } public CheturehugolVrashatelnoe() { } public void Draw(Graphics g) { } } So, we used the interface, but I just can not understand where the logic of its use, it turns out, created a template (interface) (method and 4 properties) and in 3 classes implemented them in our own way, with the same success it was possible just create 3 classes and do not make any interface, or create an abstract class and redefine where necessary the methods in the classes of the heir (it is clear why and why), but still I want to know how to correctly implement the interface in this task so that it carried some meaning in the code.
Thank you in advance.