C# Methods
After receiving a Diploma degree in civil engineering. I have opportunities working in the positions in civil engineer on road and bridge ‘s company; As a engineer at iDECOVIETNAM Consultant Company, with a bachelor degree in civil engineering in BACHKHOA University, Practice certificates for transport construction engineering design, specialized in road, bridge and infrastructure (Earthwork, embankment, ground improvement); I am seeking for a new opportunity in construction. Flexible, ambitious, tenacious and resistant to stress, I adapt myself easily to any situation and I am of the opinion that there is no problem without solution.
A method is a block of code which only runs when it is called. You can pass data, known as parameters, into a method. Methods are used to perform certain actions, and they are also known as functions. Why use methods? To reuse code: define the code once, and use it many times.
Create a Method
A method is defined with the name of the method, followed by parentheses (). C# provides some pre-defined methods, which you already are familiar with, such as Main(), but you can also create your own methods to perform certain actions:
Example
class Program
{
static void MyMethod()
{
// code to be executed
}
}
Example Explained
MyMethod() is the name of the method
static means that the method belongs to the Program class and not an object of the Program class. You will learn more about objects and how to access methods through objects later in this tutorial.
void means that this method does not have a return value. You will learn more about return values later in this chapter
![[reactjs]_ General Reactjs](https://cdn.hashnode.com/res/hashnode/image/upload/v1625530298868/LvAx2dSLY.jpeg)
![[reactjs] Responsive theo tỉ lệ màn hình với Reactjs](https://cdn.hashnode.com/res/hashnode/image/upload/v1625148968084/RQi9me1k-.png)