what can cause a thread to stop executing?
1) the program exits via a call to system.exit(0);
2) another thread is given a higher priority
3) a call to the thread's stop method.
4) a call to the halt method of the thread class
for a class defined inside a method, what rule governs access to the variables of the enclosing method?
1) the class can access any variable
2) the class can only access static variables
3) the class can only access transient variables
4) the class can only access final variables
under what circumstances might you use the yield method of the thread class
1) to call from the currently running thread to allow another thread of the same or higher priority to run
2) to call on a waiting thread to allow it to run
3) to allow a thread of higher priority to run
4) to call from the currently running thread with a parameter designating which thread should be allowed to run
what will happen when you attempt to compile and run the following code
public class hope{
public static void main(string argv[]){
hope h = new hope();
}
protected hope(){
for(int i =0; i <10; i ++){
system.out.println(i);
}
}
}
1) compilation error: constructors cannot be declared protected
2) run time error: constructors cannot be declared protected
3) compilation and running with output 0 to 10
4) compilation and running with output 0 to 9
① 凡本网注明稿件来源为"原创"的所有文字、图片和音视频稿件,版权均属本网所有。任何媒体、网站或个人转载、链接转贴或以其他方式复制发表时必须注明"稿件来源:我考网",违者本网将依法追究责任;
② 本网部分稿件来源于网络,任何单位或个人认为我考网发布的内容可能涉嫌侵犯其合法权益,应该及时向我考网书面反馈,并提供身份证明、权属证明及详细侵权情况证明,我考网在收到上述法律文件后,将会尽快移除被控侵权内容。