I am a very beginner in C#, and OOP also.

Here I am feeling an interesting matter while summing up two static variables from outer functions in C#.

Here is my code.

```
using System;

namespace StaticFun
{
    class StaticFun
    {
        public static int a;
        public static int b;

        public void count()
        {
            a++;
        }

        public void mount()
        {
            b++;
        }

        public static int getsum()
        {
            return a + b;
        }
    }

    class Program
    {
        static void Main(String[] args)
        {
            StaticFun obj = new StaticFun();

            obj.count();
            obj.count();
            obj.count();
            Console.WriteLine("Value of a for obj : {0}.", StaticFun.a);

            obj.mount();
            obj.mount();
            Console.WriteLine("\na = {0}\nb = {0}\nSum : {0}.", StaticFun.a, StaticFun.b, StaticFun.getsum());

            Console.ReadKey();
        }
    }
}

```

When I compiled this program, I get outputs like below.

> 
> Value of a for obj : 3.
> 
> 
> a = 3
> 
> 
> b = 3
> 
> 
> Sum : 3
> 
> 
> 

I can understand first two values from the output. But for b, it might be 2! Isn't it? In class StaticFun I made a function `public void mount()` to increment the value of b by 1. Since b being a static variable, its initial value was 0. Then after calling that function two times, it value would be 2. How the value can be 3, I can't understand that fact. Also, the sum might be 3+2=5, as my assumption. But it made the same value as the variable a and b as well.

I thought it happened for their static behavior. But astonishingly, it gave same output for non-static variable also!

Here is my Second code ,

```
using System;

namespace StaticFun
{
    class StaticFun
    {
        public int a;
        public int b;

        public void count()
        {
            a++;
        }

        public void mount()
        {
            b++;
        }

        public int getsum()
        {
            return a + b;
        }
    }

    class Program
    {
        static void Main(String[] args)
        {
            StaticFun obj = new StaticFun();

            obj.count();
            obj.count();
            obj.count();
            Console.WriteLine("Value of a for obj : {0}.", obj.a);

            obj.mount();
            obj.mount();
            Console.WriteLine("\na = {0}\nb = {0}\nSum : {0}.", obj.a, obj.b, obj.getsum());

            Console.ReadKey();
        }
    }
}

```

And the output as well,

> 
> Value of a for obj : 3.
> 
> 
> a = 3
> 
> 
> b = 3
> 
> 
> Sum : 3
> 
> 
> 

I completely misunderstand this fact. Is there anyone to make my concepts clear about those outputs?