Even the variable passed as out parameter is similar to ref, but there are few implementation differences when you use it in C# .
Argument passed as ref must be initialized before it is passed to the method, where as in case of out its is not necessary,but after a call to the method as an out parameter the variable must be initialized.
When to use ref and out parameter. out parameter can be used when we want to return more than one value from a method.
Enjoy..
No comments:
Post a Comment