Shortest answer :)
In C# this is accomplished with the "out" and "ref" keywords.
Pass By Reference: The variable is passed in such a way that a reassignment inside the method is reflected even outside the method.
Here follows an example of passing-by-reference (C#). This feature does not exist in java.
class Example
{
static void InitArray(out int[] arr)
{
arr = new int[5] { 1, 2, 3, 4, 5 };
}
static void Main()
{
int[] someArray;
InitArray(out someArray);
// This is true !
boolean isTrue = (someArray[0] == 1);
}
}
See also: MSDN library (C#): passing arrays by ref and out
See also: MSDN library (C#): passing by by value and by reference