格林模拟试题二(上)(7)
百度广告
what can cause a thread to stop executing?
1) the program exits via a call to system.exit(0);
3) a call to the thread's stop method.
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
3) the class can only access transient variables
question 24)
1) to call from the currently running thread to allow another thread of the same or higher priority to run
3) to allow a thread of higher priority to run
question 25)
what will happen when you attempt to compile and run the following code
public class hope{hope h = new hope();
protected hope(){
system.out.println(i);
}
1) compilation error: constructors cannot be declared protected
3) compilation and running with output 0 to 10
||| question 26)
what will happen when you attempt to compile and run the following code
public class myswitch{myswitch ms= new myswitch();
}
int k=10;
default: //put the default at the bottom, not here
break;
system.out.println("ten");
system.out.println("twenty");
}
}
1) none of these options
3) compile and run with output "this is the default output"
编辑推荐:
温馨提示:因考试政策、内容不断变化与调整,长理培训网站提供的以上信息仅供参考,如有异议,请考生以权威部门公布的内容为准! (责任编辑:长理培训)
点击加载更多评论>>