欢迎来到易学考试网 易学考试官网
全部科目 > Java认证考试 > SCJP程序员认证考试

多项选择题

public class NamedCounter { 
private final String name; 
private int count; 
public NamedCounter(String name) { this.name = name; } 
public String getName() { return name; } 
public void increment() { coount++; } 
public int getCount() { return count; }
public void reset() { count = 0; } } 
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

点击查看答案&解析

相关考题

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

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