Passing object reference to method, must it be static?
<p>When I'm trying some code to learn about passing a reference of an object to a method, I get an error when I try to remove the static in the methods head. The error message says: An object reference is required for non-static field, method or property...... But isn't there a reference in the parameter already? I have seen code that don't use static, so why does this not work? I know that static is used when method is used from classes that isn't objects. Some explanation is appreciated to understand. Thanks!</p>

<pre><code>    // Method
    internal static string ChangeName(Box obj)
    {
        return obj.BoxName;
    }
</code></pre>

<p>EDIT: I added the whole code. Is the problem that I'm calling from inside the main method that is static?</p>

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

        Box box1, box2;
        box1 = new Box("Nick","R90",1);
        box2 = new Box("Hanna","B27",2);

        Console.WriteLine(ChangeName(box2));
        Console.Read();

    }

    // Methods
    private static string ChangeName(Box obj)
    {
        return obj.BoxName;
    }
}
</code></pre>
