Passing reference type parameters to a method in C# - Online Free Computer Tutorials.

'Software Development, Games Development, Mobile Development, iOS Development, Android Development, Window Phone Development. Dot Net, Window Services,WCF Services, Web Services, MVC, MySQL, SQL Server and Oracle Tutorials, Articles and their Resources

Friday, June 3, 2011

Passing reference type parameters to a method in C#

To infer about how the reference types are passed to a method and what is the outcome.


Introduction

In developer fraternity, passing of reference type as a parameter to a method is always a topic of hot discussion. The two issues namely (i) passing the parameters (ii) type of parameters are always taken for one another and mostly it is concluded that the passing mechanism doesn't make any difference to reference type parameters. It seems true to most of developers but actually it's not complete truth. Let's see how it works. We all know that by default all parameters are passed by value.

Example:

Examples are in C#.

No comments:

Post a Comment