0
已修复

Singleton Example: synchronized(this) in static context

Micha D. Rosenbaum 5 年 前 已更新 5 年 前 2

When I try to use your code of the thread-safe Singleton example, I get an error because of the use of this in an static context. Should `this` be replaced by `Singleton.class` in this example?

解答

+2
解答
已修复

Hi Micha!

This was an unfortunate result of my recent update for this example. Please check it now, everything should be fine.

很好,我很满意
满意度评分用户: Micha D. Rosenbaum 5 年 前
+2
解答
已修复

Hi Micha!

This was an unfortunate result of my recent update for this example. Please check it now, everything should be fine.

Thanks for your fast response, Alexander! Looks good.

UserEcho 的客户支持