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 the difference between readonly and const
What is difference between private and static constructor?
What is hashtable c#?
Why do we use hashtable in c#?
Define sealed classes in c#?
What is Partial class? What purpose we use it?
What is the purpose of static?
How do I simulate optional parameters to com calls?
Can a struct inherit from an interface in c#?
Are all methods virtual in c#?
What are Memory foot print of an exe?
Explain nullable types in c#?