I want to know if in a static class, all the methods and data member should be static or can I find a non static members?
Asked
Active
Viewed 2,502 times
-5
-
No. You can't. It's the purpose main of a static class. Why do you need of it? What are you planning? maybe by showing a bit of your scenery you can get a more right desginer-implementation. – Jack Sep 28 '12 at 14:56
3 Answers
7
First link back from Google
The main features of a static class are:
- They only contain static members.

RB.
- 36,301
- 12
- 91
- 131
4
All members are static. Of course they are, because if you can't instantiate an object from that class, why would there be any non-static members?

MC Emperor
- 22,334
- 15
- 80
- 130

stealthjong
- 10,858
- 13
- 45
- 84
2
You can have a non-static class with both static and non-static methods but a static class can only have static methods.

Jeff
- 445
- 3
- 12