static methods can be accessed directly from the class, while non-static methods (or instance methods, as I like to call them) must be accessible from the instance. This is why instatiating needs to be done, for example, with methods, while for static methods this is simply not necessary.
In OOP, static variables are used for values ββthat cannot be stored by an instance variable. static methods cannot access instance methods or variables inside a class. Of course, this makes sense, because this static method would not know which instance of the class we are trying to pass.
eg. It was assumed that you would like to count the number of instances of the class? How can you save this in one copy?
References:
source share