using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication1
{
class Method
{
public static void ValueMethod(int i)
{
i++;
}
public static void ReferenceMethod(ref int i)
{
i++;
}
public static void OutputMethod(out int i)
{
i = 0;
i++;
}
static void Main()
{
int i = 0;
ValueMethod(i);
Console.WriteLine("i="+i);
int j = 0;
ReferenceMethod(ref j);
Console.WriteLine(j);
int k = 0;
OutputMethod(out k);
Console.WriteLine(k);
Console.Read();
}
}
}
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication1
{
class Method
{
public static void ValueMethod(int i)
{
i++;
}
public static void ReferenceMethod(ref int i)
{
i++;
}
public static void OutputMethod(out int i)
{
i = 0;
i++;
}
static void Main()
{
int i = 0;
ValueMethod(i);
Console.WriteLine("i="+i);
int j = 0;
ReferenceMethod(ref j);
Console.WriteLine(j);
int k = 0;
OutputMethod(out k);
Console.WriteLine(k);
Console.Read();
}
}
}
