What is a static variable and when should you use them?
Anónimo
Static variables are initialized when its associated class is created and only gets garbage collected when it's class is destroyed. A good example (but also seems to be controversial) when to use static variables would be when using the singleton approach to ensure an object is only initialized once during your app's lifecycle.