0
I dont understand parameter concept
?
4 Respostas
+ 5
The simplest answer would be that parameters are some variables (or values) that you pass to the methods so that methods can change them or do some calculation (or logic) on them.
Take a look for more details :
https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/passing-parameters
+ 3
You can write code with everything in 1 big main function.
It could be working but is hard to maintain.
So to get organised, you can divide code in to blocks.
One method, one goal
Some people like bigger blocks other keep methods as small as possible and have a lot of them.
What every you do in a method
There is some input (this is optional)
a conversion / calclation / or something else you need to do.
And a output (this one is also optional).
static public void PrintWarning(string warning)
static public void Add(int a, int b)
https://code.sololearn.com/cjHmey4l8Ba0
What you choose as input parameters is personal prefference, it is your style and logic. This seams a bit daunting at the beginning, but after a while you will create a rountine of identifing inputs and outputs.
+ 1
Please explain yourself a bit more. Do you understand method concept ? What is it you find difficult about parameters
0
sneeze I understand methods . Like when I create method what parameters I have to given