In how many ways you can pass parameters to a method?

Technology CommunityCategory: C#In how many ways you can pass parameters to a method?
VietMX Staff asked 3 years ago

There are three ways that parameters can be passed to a method:

  • Value parameters − This method copies the actual value of an argument into the formal parameter of the function. In this case, changes made to the parameter inside the function have no effect on the argument.
  • Reference parameters − This method copies the reference to the memory location of an argument into the formal parameter. This means that changes made to the parameter affect the argument.
  • Output parameters − This method helps in returning more than one value.