Questions tagged [static-methods]
99 questions
33
votes
15 answers
When do 'static functions' come into use?
OK, I've learned what a static function is, but I still don't see why they are more useful than private member functions. This might be kind of a newb-ish question here, but why not just replace all private member functions with static functions…

Dark Templar
- 6,303
- 16
- 47
- 47
2
votes
2 answers
Static or non-static?
For example I have these two classes:
First
public class Example
{
public Example()
{
}
public int ReturnSomething
{
return 1;
}
}
Second
public class Example
{
public Example()
{
}
…
0
votes
0 answers
What's the value in marking static methods in a non-static class
I had a recent code review that gave me some slightly surprising feedback. It was in an instantiable service class that had a number of fully encapsulated private methods. In other words, methods that didn't reference any higher level functions or…

Bob Tway
- 3,636
- 3
- 21
- 26