C# supports methods defined on struct types, similar to other object-oriented languages.
To run the program, save it as Methods.cs and use the C# compiler:
In C#, structs are value types, and methods are always called on the struct instance. There’s no concept of pointer receivers as in some other languages. If you need reference semantics, you would typically use a class instead of a struct.
Next, we’ll look at C#’s mechanism for grouping and naming related sets of methods: interfaces.