Setting the Scene By looking at the following two methods, arguably they seem to do the same thing. But they must be doing something different, hence there existence. So let’s find out.
private void FetchOutSomething(out Something sthg)
sthg = new Something(DateTime.Now.Year);
private Something FetchSomething()
return new Something(DateTime.Now.Year);
What is passing by reference? In C# method arguments are either passed by value or by reference. By value means passing a…