题目内容

classComputationextendsThread{
privateintnum;
privatebooleanisComplete;
privateintresult;
publicComputation(intnum){this.num=num;}
publicsynchronizedvoidrun(){
result=num*2;
isComplete=true;
notify();
}
publicsynchronizedintgetResult(){
while(!isComplete){
try{
wait();
}catch(InterruptedExceptione){}
}
returnresult;
}
publicstaticvoidmain(String[]args){
Computation[]computations=newComputation[4];
for(inti=0;i<computations.length;i++){
computations[i]=newComputation(i);
computations[i].start();
}
for(Computationc:computations)
System.out.print(c.getResult()+);
}
}
Whatistheresult?()

查看答案
更多问题

期权内在价值 名词解释

importjava.util.*;
publicclassNameList{
privateListnames=newArrayList();
publicsynchronizedvoidadd(Stringname){names.add(name);}
publicsynchronizedvoidprintAll(){
for(inti=0;iSystem.out.print(names.get(i)+);
}
}
publicstaticvoidmain(String[]args){
finalNameListsl=newNameList();
for(inti=0;i<2;i++){
newThread(){
publicvoidruin(){
sl.add(”A”);
sl.add(”B”);
sl.add(”C”);
sl.printAll();
}
}.start();
}
}
}
Whichtwostatementsaretrueifthisclassiscompiledandrun?()

简要说明同业拆借市场的主要特点。

影响汇率变动的长期因素、短期因素主要包括哪些方面?它们又是如何影响汇率变动的?

答案查题题库