wait会释放资源。而sleep不会释放资源。wait必须包含在synchronized代码块中