C
christery
why? static works but not public on "a"...
First I thougt OK, but then... why not eaven private in the same
class...
Am I missing something about scope? Test.Program.a wont work either I
guess..
saw this as a q and now I got interested...
using System;
using System.Collections.Generic;
using System.Text;
namespace Test
{
class Program
{
static int[] a = { 2, 4, 6, 8 };
static void Main(string[] args)
{
for (int n = 0; n < 4; n++)
Console.WriteLine(a[n]);
Console.ReadKey();
}
}
}
First I thougt OK, but then... why not eaven private in the same
class...
Am I missing something about scope? Test.Program.a wont work either I
guess..
saw this as a q and now I got interested...
using System;
using System.Collections.Generic;
using System.Text;
namespace Test
{
class Program
{
static int[] a = { 2, 4, 6, 8 };
static void Main(string[] args)
{
for (int n = 0; n < 4; n++)
Console.WriteLine(a[n]);
Console.ReadKey();
}
}
}