‫In this video, we'll learn about method parameters.
‫A method parameter is a value accepted by the method and placed inside these parentheses.
‫A method can also have any number of parameters.
‫For example, if I need to change this method to accept two numbers and return the result of their summation.
‫So instead of creating these numbers, I'll pass here them as parameters.
‫So int x and int y.
‫So this method accepts two parameters of type int.
‫The first one is x and the second one is Y, and the returning type of this method is int.
‫So I should include a return statement.
‫And here the operation that I should return.
‫But how to pass these values, how to tell the the method here that X is ten and y is 20.
‫For example, if a method is created with parameters, we need to pass the corresponding values while
‫calling the method.
‫So let me go up and here you can see that there is an error expected two arguments but found zero because
‫we didn't pass any argument so that these are the parameters.
‫And when you pass the values when calling the method are called arguments here, I'll pass ten and I'll
‫pass 20.
‫You can see that Android studio generates a hint that telling us that X is ten and Y is 20.
‫So I don't write anything here.
‫I don't specify x equal to ten.
‫For example, just put the value directly ten and to zero.
‫You can see Android Studio will generate these hints.
‫You can see that add numbers will accept int x and int y, run the program and change the value of the
‫addition, the value of some run and you can see that the value of some is 30.
‫We passed these arguments ten and 20 to the method add numbers that accepts two parameters of type int
‫x and y, and since it's returning type is an integer, we return it inside a return statement.
‫The addition of these numbers.