w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
understanding the relationship between static and weak reference

Static means there's only one instance of that variable that every instance of that class shares. Removing the static would mean that there are more of those maps around (one per instance of the class) and that those instances wouldn't have the same data.

Weak references are totally different. They are ways to keep a reference around but still let a variable be garbage collected if nobody else needs it. The two concepts have nothing to do with each other.





© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.