method scope variable
using System;
class IncDecApp
{
public static void Foo(int j)
{
Console.WriteLine("IncDecApp.Foo j = {0}", j);
}
static void Main(string[] args)
{
int i = 1;
Console.WriteLine("Before Foo(i++) = {0}", i);
Foo(i++);
Console.WriteLine("After Foo(i++) = {0}", i);
Console.WriteLine();
Console.WriteLine("Before Foo(++i) = {0}", i);
Foo(++i);
Console.WriteLine("After Foo(++i) = {0}", i);
}
}
Related examples in the same category