为了确保实现是线程安全的,实现该接口的类应该在方法上使用synchronized关键字,或者在方法内部使用同步锁。
To ensure that your implementation is thread-safe, a class that implements this interface should use either the synchronized keyword on the methods or synchronized blocks within the methods.
为了确保实现是线程安全的,实现该接口的类应该在方法上使用synchronized关键字,或者在方法内部使用同步锁。
To ensure that your implementation is thread-safe, a class that implements this interface should use either the synchronized keyword on the methods or synchronized blocks within the methods.
应用推荐