Top "Static-methods" questions

Methods that neither require an instance of the class nor can they implicitly access the data (or this, self, Me, etc.

accessing static member from non-static function in typescript

I am trying to access a static member from a non-static function in the class, and I get an error …

typescript static-methods static-members non-static
Why is using static helper methods in Java bad?

I'm asking because I'm trying to use a mocking framework (Mockito) which does not allow you to mock static methods. …

java android static-methods mockito helpermethods
static member functions inheritance

I am new to C++ programming, i have a got doubt while doing some C++ programs, that is how to …

c++ inheritance static-methods dynamic-binding
Difference between static function and singleton class in swift

I want to create a class where all utility methods will be kept and these methods will be used throughout …

ios swift singleton static-methods
Static functions vs const functions

I'm looking at a member function int funct(int x) const; And I'm wondering if static int funct(int x); …

c++ static-methods
Static method (which isn't class method) in objective C

While reading THIS question and accepted answer for the question, I was unable to get the difference between these two …

objective-c static-methods class-method
ReSharper complains when method can be static, but isn't

Why does ReSharper complain when a method can become static, but is not? Is it because only one instance of …

c# resharper static-methods
Does using static methods and properties in PHP use less memory?

I'm working on a web application that sees dozens of concurrent users per second. I have a class that will …

php memory-management memory-leaks static-methods
Java no name static method

What is this? public class ABC { public ABC() { System.out.println("world"); } static { System.out.println("hello"); } } Will print: hello …

java static-methods
Are static methods a DI anti-pattern?

I am a Java developer who is beginning to grasp the full power of dependency injections, and it suddenly dawned …

java dependency-injection mocking static-methods