Top "Static-members" questions

A static member is a data field that is shared by all instances of a class or structure for the same program.

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 a non-static inner-class cannot have static members (fields and methods)?

Possible Duplicate: Why cant we have static method in an inner class? I know that the creation of a non-static …

java static inner-classes static-members non-static
Private class functions vs Functions in unnamed namespace

I've found myself that I tend not to have private class functions. If possible, all candidates to private class function …

c++ namespaces coding-style static-members api-design
Is it possible to declare a virtual static constant value in a C++ class?

I'd like to have a base class that has a constant field (like an unique ID associated with the class …

c++ inheritance virtual constants static-members
What is the scope of variables declared inside a static block in java?

Are variables declared inside a static block accessible anywhere else? What "kind" of member are they(ie., are they static …

java static static-members
get static initialization block to run in a java without loading the class

I have a few classes as shown here public class TrueFalseQuestion implements Question{ static{ QuestionFactory.registerType("TrueFalse", "Question"); } public TrueFalseQuestion(){} } ... …

java static-members static-initializer
What is the lifetime of class static variables in C++?

If I have a class called Test :: class Test { static std::vector<int> staticVector; }; when does staticVector get …

c++ static-members lifetime
Why aren't static data members allowed in local classes?

What is the reasoning to why static const members cannot exist in local classes? It seems like a rather silly …

c++ static static-members local-class
Access to static properties via this.constructor in typescript

I want to write es6 class: class SomeClass { static prop = 123 method() { } } How to get access to static prop from method() …

typescript this static-methods static-members typescript1.6
Why must non-integral static data members initialized in the class be constexpr?

Static integral data members initialized in the class definition may be declared const or constexpr, but non-integral static data members …

c++ c++11 static-members constexpr