For Asp.net Training with C# Click Here
Written By:-Isha Malhotra
Email:-malhotra.isha3388@gmail.com
More about Static
Let’s have some more detail about static:-
1.
We cannot use this statement with static.
For example:-
See the following example
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
/// <summary>
/// Summary description for Class1
/// </summary>
public class Class1
{
public int x;
public static int y;
public void sum(int x, int y)
{
this.x = x;
}
}
In this example we create two variable x and
y in which y is static variable. We can use non static variable with this but
we cannot use static with this.