Define the difference between ref and out parameters?

1 Answers

Rahul Roi
Rahul Roi

The Output parameters are similar to reference parameters, except that they transfer data out of the method rather than into it. And the Reference parameter copies the reference to the memory location of an argument into the formal parameter. Its means that changes made to the parameter affect the argument.

The Value parameters − This method copies the actual value of an argument into the formal parameter of the function. Into this case, changes made to the parameter inside the function have no effect on the argument.

The Reference parameters − These method copies the reference to the memory location of an argument into the formal parameter. It means that changes made to the parameter affect the argument.

The Output parameters − These method helps in returning more than one value.

Answer