在下列SynchronizedCounter类的定义中, 为了保证并发操作的正确性, 应在下划线处填入的代码自上而下分别是()public class SynchronizedCounter { private int c = 0; public ___________ void increment() { c++; } public ___________ void decrement() { c--; } public ___________ int value() { return c; }}
A. 都可以不填
B. synchronized, synchronized, 可不填
C. 可不填, 可不填, synchronized
D. synchronized, synchronized, synchronized
查看答案
Java中, 定义子类继承父类用到的关键字是()
A. extends
B. this
C. inheritance
D. final
定义接口的关键字是()
A. public
B. private
C. interface
D. final
执行下列程序段时, 若文件"file.dat"不存在, 则输出结果是()try { FileInputStream fis = new FileInputStream("file.dat");} catch (FileNotFoundException e) { System.out.print("FileNotFoundException")} catch (IOException e) { System.out.print("IOException")}
A. FileNotFoundException
B. IOException
C. FileNotFoundException IOException
D. 空
压缩流所在的包是()
A. java.util.zip
B. java.sound.sampled
C. javax.imageio
D. javax.xml.stream