declaring a public variable causes everything to have a "name does not exist in this context" error : <pre><code>    using System;

namespace GridSim
{
    class Program
    {
        static void Main()
        {

//error is right before declaring public. "} expected"
            public int h = 1;

            CreateWorld.Create();
        }
    }
}
</code></pre>

<p>I have a another class to create a grid in a nested for loop. the class is public. declaring a public variable ANYWHERE IN MY PROJECT yields the same result. </p>

<p>"} expected" before the public variable.</p>

<p>"The name "(insert thing here)" does not exist in this context" for literally everything after the public variable. </p>

<p>I want to be able to set a part of a grid to a character from anywhere in my project, but this error is preventing me from doing that.</p>
