Зміст курсу
C# Beyond Basics
C# Beyond Basics
Class Methods
Just like structs, classes can also have methods. The syntax for creating and calling methods is also very similar:
For example, we can create a class called Rectangle
with width
and height
attributes and a method called area
, which calculates the area of the rectangle object based on the width
and height
values:
index
index
Все було зрозуміло?