public void SwapByValue(int x, int y)
public void SwapByReference(ref int x, ref int y)
public void OutParameter(int x, out int y)
public void ParameterArray(params int[] a)
Console.WriteLine(s + "\t");
public void ObjectParameterArray(params object[] a)
Console.WriteLine(s + "\t");
public static void Main(string[] args)
ParamPassing pp = new ParamPassing();
Console.WriteLine("Before Swapping");
Console.WriteLine("a = " + a + "\t b = " + b);
pp.SwapByReference(ref a, ref b);
Console.WriteLine("After Swapping");
Console.WriteLine("a = " + a + "\t b = " + b);
Console.Write("Out Parameter = ");
pp.OutParameter(a, out b);
Console.WriteLine("b = "+b);
Console.WriteLine("Parameter Array with 10 elements");
pp.ParameterArray(10,23,44,35,65,76,88,97,45,66);
Console.WriteLine("Parameter Array with 5 elements");
pp.ParameterArray(10, 23, 35, 88, 66);
Console.WriteLine("Object Parameter Array with 5 elements");
pp.ObjectParameterArray(21, 23.44, 67.8889, 'n' ,"dombivli");