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
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 |
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 |
Answer / luckraj
Static class does not allow to create
any object.....
Is This Answer Correct ? | 9 Yes | 9 No |
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 |
What is using in c#?
How did you implemented classes in your project?
What is c# best for?
Is cli same as the clr?
how to communicate inventory system and account system?
What is hashtable in c# with example?
What is args c#?
Explain the difference between the system.array.copyto() and system.array.clone()?
Does c# supports destructors?
Which of these statements correctly declares a two-dimensional array in c#?
Where do we set the min and max pool size for connection pooling?
What is the difference between Object and class adapters?