Hello
I have created a class also a constructor which is (should be, one of the conditions) private.
Now I am supposed to call it in the main program. My team leader says there is a trick to call it. I can call the variable j(as it is static). but not con.
Please help me out.
[code=cpp]
public class con
{
private con()
{
Console.WriteLi ne("private constructor");
}
public static int j = 5;
}
}
[/code]
Thanking you
cmrhema
I have created a class also a constructor which is (should be, one of the conditions) private.
Now I am supposed to call it in the main program. My team leader says there is a trick to call it. I can call the variable j(as it is static). but not con.
Please help me out.
[code=cpp]
public class con
{
private con()
{
Console.WriteLi ne("private constructor");
}
public static int j = 5;
}
}
[/code]
Thanking you
cmrhema
Comment