JAVA认证历年真题:SCJP认证套题解析(3)

来源:java认证发布时间:2012-11-12 13:05:51java认证视频

57、Which of the following answer is correct to express the value 10 in hexadecimal number?
A. 0xA
B. 0x16
C. 0A
D. 016
(a)
题目:下面的哪些答案可以正确表示一个十六进制数字10。
十六进制数以0x开头,以0开头的是八进制数。十六进制表示中的a,b,c,d,e,f依次为10,11,12,13,14,15。

58、Which statements about thread are true?
A. Once a thread is created, it can star running immediately.
B. To use the start() method makes a thread runnable, but it does not necessarily start immediately.
C. When a thread stops running because of pre-emptive, it is placed at the front end of the runnable queue.
D. A thread may cease to be ready for a variety of reasons.
(bd)
题目:有关线程的哪些叙述是对的。
A.    一旦一个线程被创建,它就立即开始运行。
B.    使用start()方法可以使一个线程成为可运行的,但是它不一定立即开始运行。
C.    当一个线程因为抢先机制而停止运行,它被放在可运行队列的前面。
D.    一个线程可能因为不同的原因停止(cease)并进入就绪状态。
一个新创建的线程并不是自动的开始运行的,必须调用它的start()方法使之将线程放入可运行态(runnable state),这只是意味着该线程可为JVM的线程调度程序调度而不是意味着它可以立即运行。线程的调度是抢先式的,而不是分时间片式的。具有比当前运行线程高优先级的线程可以使当前线程停止运行而进入就绪状态,不同优先级的线程间是抢先式的,而同级线程间是轮转式的。一个线程停止运行可以是因为不同原因,可能是因为更高优先级线程的抢占,也可能是因为调用sleep()方法,而即使是因为抢先而停止也不一定就进入可运行队列的前面,因为同级线程是轮换式的,它的运行可能就是因为轮换,而它因抢占而停止后只能在轮换队列中排队而不能排在前面。

59、The method resume() is responsible for resuming which thread's execution?
A. The thread which is stopped by calling method stop()
B. The thread which is stopped by calling method sleep()
C. The thread which is stopped by calling method wait()
D. The thread which is stopped by calling method suspend()
(d)
题目:方法resume()负责恢复哪些线程的执行。
A.    通过调用stop()方法而停止的线程。
B.    通过调用sleep()方法而停止运行的线程。
C.    通过调用wait()方法而停止运行的线程。
D.    通过调用suspend()方法而停止运行的线程。
Thread的API文档中的说明是该方法恢复被挂起的(suspended)线程。该方法首先调用该线程的无参的checkAccess() 方法,这可能在当前线程上抛出SecurityException 异常,如果该线程是活着的(alive)但是被挂起(suspend),它被恢复并继续它的执行进程。

60、Given the following code:
1) public class Test {
2)    int m, n;
3)    public Test() {}
4)    public Test(int a) { m=a; }
5)    public static void main(String arg[]) {
6)       Test t1,t2;
7)       int j,k;
8)       j=0; k=0;
9)       t1=new Test();
10)       t2=new Test(j,k);
11)     }
12) }
Which line would cause one error during compilation?
A. line 3
B. line 5
C. line 6
D. line 10
(d)
题目:给出下面的代码:

在编译时哪行将导致一个错误。
第10行的声明调用一个带两个参数的Test的构造方法,而该类没有这样的构造方法。

上一页345下一页

视频学习

我考网版权与免责声明

① 凡本网注明稿件来源为"原创"的所有文字、图片和音视频稿件,版权均属本网所有。任何媒体、网站或个人转载、链接转贴或以其他方式复制发表时必须注明"稿件来源:我考网",违者本网将依法追究责任;

② 本网部分稿件来源于网络,任何单位或个人认为我考网发布的内容可能涉嫌侵犯其合法权益,应该及时向我考网书面反馈,并提供身份证明、权属证明及详细侵权情况证明,我考网在收到上述法律文件后,将会尽快移除被控侵权内容。

最近更新

社区交流

考试问答