每次ML的时候男友都要我穿丝袜。。。。。。。# Joke - 肚皮舞运动
s*e
1 楼
Question:
A J2SE 5.0 class ThirdPartyObject, that is not thread-safe, is to be used
in some new java code. Which of the following design decision can be made to
ensure that no race condition will occour?
A. Store instance of ThirdPartyObject in a ThreadLocal
B. Provide a static getter for a ThirdPartyObject instance
C. Ensure that an instance of ThirdPartyObject is private and can only be
accessed using a public getter method
D Make any instance of ThirdParyObject a local(method) variable and ensure
that no reference to it are published
E. Use @Immutable as an annotation with ThirdPartyObject instances.
ABCDE 请问大家会选哪个,或那几个?
请说明为什么?
谢谢!
A J2SE 5.0 class ThirdPartyObject, that is not thread-safe, is to be used
in some new java code. Which of the following design decision can be made to
ensure that no race condition will occour?
A. Store instance of ThirdPartyObject in a ThreadLocal
B. Provide a static getter for a ThirdPartyObject instance
C. Ensure that an instance of ThirdPartyObject is private and can only be
accessed using a public getter method
D Make any instance of ThirdParyObject a local(method) variable and ensure
that no reference to it are published
E. Use @Immutable as an annotation with ThirdPartyObject instances.
ABCDE 请问大家会选哪个,或那几个?
请说明为什么?
谢谢!