What will happen if we create object of an static class?

 Posted by vishalneeraj-24503 on 1/23/2014 | Category: C# Interview questions | Views: 1137 | Points: 40
Answer:

First of all,we can not create static class object.
But if we explicitly create object,then at compile-time,it will give error as:

Static classes cannot have instance constructors

Meaning that,static class do not have public constructors.It always as private constructors.So this is the reason,we can not create object of static classes.


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response