Understanding static in C#
<p>I'm learning C# and I'm having trouble understanding the <code>static</code> keyword. </p>

<p>Say I have the following code:</p>

<pre><code>using System;
using System.IO;
using System.IO.Ports;

class PortThing
{
    SerialPort port;

    void InitPort()
    {
        if(!File.Exists("/dev/whatever"))
        {
            System.Console.WriteLine("Device not found.");    
            port = null;  
        }
        //else port = something
    }

    public static void Main(string[] args)
    {
        InitPort();
        System.Console.WriteLine("Done.");
    }
}
</code></pre>

<p>As far as I can understand, a static method is one that belongs to the class rather than to the object of that class. So static methods can't reference nonstatic methods/fields since they require instantiating a class.</p>

<p>Compiler complains about <code>Main()</code> calling <code>InitPort()</code> and wants to make it static. I could do so but that would require to make <code>port</code> a static field. Following this line of thought, everything would end up being static.</p>

<p>What am I getting wrong?</p>
