Errors I get when I try to move everything under the main method and make everything static
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/3754722/modify-or-convert-to-static-methods">Modify or convert to static methods</a>  </p>
</blockquote>



<p>I would like to use static methods but I am not sure how to do it can someone explain how? I am trying to make everything static then move it in the main method and get rid of the accounts class all together. At the bottom I listed all the errors I get.</p>

<pre><code>static void Main(string[] args)
{


    private static int[] accountnum = new int[5]; //private accountnum array of five integer account numbers
    private static int[] accountbal = new int[5];//private balance array of five balance amounts
    private static string[] accountname = new string[5];//private accntname array to hold five last names


    public static void fillAccounts()
    {
        int bal;
        int accountnumber;
        string name;

        for (int x = 0; x &lt; 5; ++x)
        {



            Console.Write("Enter the account number ==&gt;&gt;");
            accountnumber = int.Parse(Console.ReadLine());
            Console.Write("Enter the integer the account balance ==&gt;&gt;");
            bal = int.Parse(Console.ReadLine());
            Console.Write("Enter the account holder lastname ==&gt;&gt;");
            name = Console.ReadLine();


            accountnum[x] = accountnumber;
            accountbal[x] = bal;
            accountname[x] = name;
        }




    }

    public static void searchAccounts()
    {
        int acctnum;
        Console.WriteLine("Enter the account number ==&gt;&gt;");


        acctnum = int.Parse(Console.ReadLine());
        for (int x = 0; x &lt; 6; ++x)
        {
            if (x &lt; 5)
            {
                if (accountnum[x] == acctnum)
                {
                    Console.WriteLine("Account #{0} has a balance of {1} for customer {2}", acctnum, accountbal[x].ToString("C"), accountname[x]);
                    break;
                }
            }
            else
            {
                Console.WriteLine("You entered invalid account number");
            }
        }

    }


    public static void averageAccounts()
    {
        int sum = 0;
        int avg;


        for (int x = 0; x &lt; 5; ++x)
        {
            sum = accountbal[x] + sum;
        }
        avg = sum / 5;
        Console.WriteLine("The average dollar amount is {0}", avg.ToString("c"));
    }


    myclass.fillAccounts();

    string userin = null;


    while (userin != "x")
    {
        //use the following menu:
        Console.WriteLine("*****************************************");
        Console.WriteLine("enter an a or A to search account numbers");
        Console.WriteLine("enter a b or B to average the accounts");
        Console.WriteLine("enter an x or X to exit program");
        Console.WriteLine("*****************************************");
        Console.Write("Enter option--&gt;");
        userin = Console.ReadLine();
        if (userin == "a" || userin == "A")
        {
            myclass.searchAccounts();
        }
        else if (userin == "b" || userin == "B")
        {
            myclass.averageAccounts();
        }
        else if (userin == "x" || userin == "X")
        {
            break;
        }

        else
        {
            Console.WriteLine("You entered an invalid option");
        }
    }
}
}
}
}
</code></pre>

<p>&nbsp;</p>

<pre><code>Error 2 Invalid token '(' in class, struct, or interface member declaration C:\Users\Error 3 Invalid token 'while' in class, struct, or interface member declaration Error 4 Invalid token '!=' in class, struct, or interface member declaration
Error 5 Invalid token '(' in class, struct, or interface member declaration C Error 6 Invalid token '(' in class, struct, or interface member declaration Error 7 Invalid token '(' in class, struct, or interface member declaration Error 8 Invalid token '(' in class, struct, or interface member declaration Error 9 Invalid token '(' in class, struct, or interface member declaration Error 10 Invalid token '(' in class, struct, or interface member declaration Error 11 Invalid token '=' in class, struct, or interface member declaration Error 12 Invalid token '(' in class, struct, or interface member declaration Error 13 Invalid token '==' in class, struct, or interface member declaration
Error 14 Invalid token '==' in class, struct, or interface member declaration
Error 15 Invalid token '(' in class, struct, or interface member declaration Error 16 A namespace does not directly contain members such as fields or methods Error 17 Type or namespace definition, or end-of-file expected
Error 18 Type or namespace definition, or end-of-file expected Error 19 Type or namespace definition, or end-of-file expected
Error 20 Type or namespace definition, or end-of-file expected 
</code></pre>
