Skip to main content

Questions tagged [static]

The static keyword, in object-oriented programming languages, is used to define a function/method or field/property as bound to the context of a type/class, but not to any specific instance. Unlike constants, static properties can usually be changed at runtime. static also refers to the storage class in languages like C. static variables are initialized once, at run-time, and persist in between function calls (i.e. they aren't re-initialized).

3 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
2 votes
0 answers

Multiple CResourceUsers using a single CResource

I need multiple CResourceUsers to share one instance of CResource. I want to instantiate the ...
Teni's user avatar
  • 21
2 votes
0 answers

Threadsafe static initialization of ExecutorService

I am trying to create a threadsafe singleton class based on Initialization-on-demand holder idiom . Here is my code ...
Steve's user avatar
  • 21
1 vote
0 answers

Mocking protocol with class/static functions in Swift

I am using one of the open-source Objective-C keychain wrappers to store data in iOS keychain. For test cases, I have created protocol as: ...
D4ttatraya's user avatar