Hi, all
When we use static constructor ?
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Jul 6, 2011, 7:11 AM
ranjithPosted Jul 6, 2011, 2:39 AM
so, when we are calling static class method if we want to use the values dynamically inside the method then we will go for static constructor.
eg:
public static int somevalue;
class1.CallingStaticMethod(x);
Class1()
{
if(x==10)
somevalue=20;
else
somevalue=30;
}
CallingStaticMethod(int integervalue)
{
int result;
result=somevalue+integervalue;
}