Another subclass of reference, soft references, fulfills a different but related purpose.
Reference的另一个子类——软引用——可满足一个不同却相关的目的。
Similarly, soft references are also often used in GUI applications for caching bitmap graphics.
类似地,软引用也经常用于 GUI 应用程序中,用于缓存位图图形。
As the following example shows, weak references and soft references are powerful tools for fixing memory leaks.
如以下示例所示,弱引用和软引用都是解决内存泄露的强大工具。
应用推荐