why we can't create an object for a static class??
what is the reason behind this?

Answers were Sorted based on User's Feedback



why we can't create an object for a static class?? what is the reason behind this?..

Answer / pushparaj pentakota

static blocks and static classes are executed before
constructor execution but object can be created while
executing the constructor only but static blocks are exected
before executing construtor so we can't create an object on
static classes.

Is This Answer Correct ?    23 Yes 2 No

why we can't create an object for a static class?? what is the reason behind this?..

Answer / rahul

Because static method will have defined / stored entry point.
so while calling it , it's entry point is sufficient , without creating an object.
that's why no need to create object

Is This Answer Correct ?    3 Yes 0 No

why we can't create an object for a static class?? what is the reason behind this?..

Answer / luckraj

Static class does not allow to create
any object.....

Is This Answer Correct ?    9 Yes 9 No

why we can't create an object for a static class?? what is the reason behind this?..

Answer / pushparaj pentakota (anakapall

static blocks and static classes are executed before
constructor execution but object can be created while
executing the constructor only but static blocks are exected
before executing construtor so we can't create an object on
static classes.

Is This Answer Correct ?    1 Yes 1 No

Post New Answer

More C Sharp Interview Questions

What is the difference between readonly and const

4 Answers   Emphasis,


What is difference between private and static constructor?

0 Answers  


What is hashtable c#?

0 Answers  


Why do we use hashtable in c#?

0 Answers  


Define sealed classes in c#?

0 Answers  






What is Partial class? What purpose we use it?

6 Answers   ACS, TATA,


What is the purpose of static?

0 Answers  


How do I simulate optional parameters to com calls?

0 Answers  


Can a struct inherit from an interface in c#?

0 Answers  


Are all methods virtual in c#?

0 Answers  


What are Memory foot print of an exe?

0 Answers   MCN Solutions,


Explain nullable types in c#?

0 Answers  


Categories