Top "Static" questions

Static is a term used in some programming languages to define a function or data storage area (field) that is not bound to any specific object instance.

Adding a favicon to a static HTML page

I have a few static pages that are just pure HTML, that we display when the server goes down. How …

html static favicon
Are static class variables possible in Python?

Is it possible to have static class variables or methods in Python? What syntax is required to do this?

python class oop static class-variables
What does "static" mean in C?

I've seen the word static used in different places in C code; is this like a static function/class in …

c syntax static
What does the 'static' keyword do in a class?

To be specific, I was trying this code: package hello; public class Hello { Clock clock = new Clock(); public static void …

java static oop language-features restriction
Mocking static methods with Mockito

I've written a factory to produce java.sql.Connection objects: public class MySQLDatabaseConnectionFactory implements DatabaseConnectionFactory { @Override public Connection getConnection() { try { …

java unit-testing static mocking mockito
What is the reason behind "non-static method cannot be referenced from a static context"?

The very common beginner mistake is when you try to use a class property "statically" without making an instance of …

java static
Static variables in JavaScript

How can I create static variables in Javascript?

javascript variables static closures
What is a "static" function in C?

The question was about plain c functions, not c++ static methods, as clarified in comments. I understand what a static …

c function static terminology
Difference between static class and singleton pattern?

What real (i.e. practical) difference exists between a static class and a singleton pattern? Both can be invoked without …

design-patterns static singleton
Why is the Java main method static?

The method signature of a Java main() method is: public static void main(String[] args){ ... } Is there a reason for …

java static main