4.9 Method
Hello, in the previous course we have seen how to function the if condition and how to use in this course we will see the methods then what is a method. a method is very simple, a subprogram executes instructions, they are lines of code, we call them instructions because when you write them, you indicate to the machine what it will do. indicate to the machine what it will have to do. Here, for example, we will create an instruction that simply writes hello developer in the console. Here, the method is called hello and contains instructions. So at runtime, when we call it in our code so that it can execute its instructions in the console, we will have "hello developer". We will see in this course how to declare a method and how to call it, moving on to the declaration of methods. The methods have a return type in the first example, the return type is a string the methods also have names in the second example the name of our method is addition. Then the parameters there are parameters as in the second example and others that don't have as in the first example and then there are parameters as in the second example. in the first example and then there is the course of the method. In the second example the course of the method is to perform additions And in the return we have the result of our addition In the next lessons we will make examples and exercises and challenges that will allow to take me to the construction of a method.