请问synchronized是什么?
binny 2003-09-16 01:03:45 /**
* Allocates a new string that contains the sequence of characters
* currently contained in the string buffer argument. The contents of
* the string buffer are copied; subsequent modification of the string
* buffer does not affect the newly created string.
*
* @param buffer a <code>StringBuffer</code>.
* @throws NullPointerException If <code>buffer</code> is
* <code>null</code>.
*/
public String (StringBuffer buffer) {
synchronized(buffer) {
buffer.setShared();
this.value = buffer.getValue();
this.offset = 0;
this.count = buffer.length();
}
}
这里面的synchronized是什么?是谁的方法,它能实现什么效果?