Following are the difference between Static and Non-Static Constructor:-
4. Static constructor call automatically when class load first time and we cannot call Static constructor using program. However, we call non-static constructor using program at the time of object creation.
5. We cannot overload static constructor, as it is parameter less constructor. We cannot pass parameter to static constructor. However, we can overload non-static constructor.
public class abc
{
public static int k;
public int x, y;
static abc()
{
k = 10;
}
public abc(int p, int q)
{
x = p;
y = q;
k = 20;
}
}