一道题,关于线程
ttt 2002-02-06 09:04:02 Which of the following best describes the use of the synhronized keyword?
1) Allows two process to run in paralell but to communicate with each other
2) Ensures only one thread at a time may access a method or object
3) Ensures that two or more processes will start and end at the same time
4) Ensures that two or more Threads will start and end at the same time
我觉得就2有点对,不过也不完全,应该不包括method吧,因为锁本来就是基于object的。