欢迎来到求知题库网 求知题库官网
logo
全部科目 > Java认证考试 > SCJP程序员认证考试

多项选择题

Given that Triangle implements Runnable, and:

Which two statements, inserted independently at both lines 35 and 41, tend to allow both threads to temporarily pause and allow the other thread to execute?()

    A.Thread.wait();
    B.Thread.join();
    C.Thread.yield();
    D.Thread.sleep(1);
    E.Thread.notify();

点击查看答案

相关考题

  • 多项选择题
    Which three changes should be made to adapt this class to be used safely by multiple threads?()

    A.declare reset() using the synchronized keyword
    B.declare getName() using the synchronized keyword
    C.declare getCount() using the synchronized keyword
    D.declare the constructor using the synchronized keyword
    E.declare increment() using the synchronized keyword

  • 单项选择题
    What is the result?()

    A.Compilation fails.
    B.An exception is thrown at runtime.
    C.The code executes and prints "running".
    D.The code executes and prints "runningrunning".
    E.The code executes and prints "runningrunningrunning".

  • 单项选择题
    What is the result?()

    A.Compilation fails.
    B.An exception is thrown at runtime.
    C.The code executes normally and prints "sleep".
    D.The code executes normally, but nothing is printed.

微信小程序免费搜题
微信扫一扫,加关注免费搜题

微信扫一扫,加关注免费搜题

微信扫一扫,加关注免费搜题

微信扫一扫,加关注免费搜题