0
点赞
收藏
分享

微信扫一扫

wait和sleep的区别

wait和sleep的区别

try {
    Thread.sleep(3000L);
} catch (InterruptedException e) {
    e.printStackTrace();
}

synchronized (lock){
    try {
        lock.wait();
    } catch (InterruptedException e) {
        e.printStackTrace();
    }
}
举报

相关推荐

0 条评论