- Cannot derive from Static Class
- Cannot create instance of Static class using new keyword
- Static class can be public or internal
- Static class can NOT be private or protected or protected internal
- Static class can NOT have non-static members
1)
static class ThisClassIsStatic
{
static string comment;
static int count = 0;
}
class ThisIsDervied : ThisClassIsStatic //NOT POSSIBLE
{
}
2)
ThisClassIsStatic obj = new ThisClassIsStatic(); //NOT POSSIBLE
3)
public static class ThisClassIsStatic //POSSIBLE
{
}
4)
private static class ThisClassIsStatic //NOT POSSIBLE
5)
static class ThisClassIsStatic
{
static string comment;
static int count = 0;
int index = 0; //NOT POSSIBLE
}
private static class ThisClassIsStatic //NOT POSSIBLE
5)
static class ThisClassIsStatic
{
static string comment;
static int count = 0;
int index = 0; //NOT POSSIBLE
}
No comments:
Post a Comment