publicclassTestFive{privateintx;publicvoidfoo(){intcurrent=x;x=current+1;}publicvoidgo(){for(inti=0;i<5;i++){newThread(){publicvoidrun(){foo();System.out.print(x+,);}}.start();}}}Whichtwochanges,takentogether,wouldguaranteetheoutput:1,2,3,4,5,?()
A.Movetheline12printstatementintothefoo()method.
B.Changeline7topublicsynchronizedvoidgo(){.
C.Changethevariabledeclarationonline3toprivatevolatileintx;.
D.Wrapthecodeinsidethefoo()methodwithasynchronized(this)block.
E.Wraptheforloopcodeinsidethego()methodwithasynchronizedblocksynchronized(this){//forloopcodehere}.
第1题:
第2题:
第3题:
下列关于整除的命题中,正确的是______。
A.若f(x)|g(x)+h(x),则f(x)|g(x)或f(x)|h(x)
B.若f(x)|g(x)+h(x),且f(x)|g(x),则f(x)|h(x)
C.若f(x)|g(x)h(x),则f(x)|g(x)或f(x)|h(x)
D.若f(x)|g(x)h(x),且f(x)不整除g(x),则f(x)|h(x)
第4题:
第5题: