题目

public class X implements Runnable (   private int x;   private int y;    public static void main(String args) (   X that = new X();   (new Thread(that)) . start( );   (new Thread(that)) . start( );   )    public synchronized void run( ) (    for (;;) (    x++;    y++;    System.out.printIn(“x = “ + x + “, y = “ + y);    )   )    )   What is the result?()

A、 An error at line 11 causes compilation to fail.

B、 Errors at lines 7 and 8 cause compilation to fail.

C、 The program prints pairs of values for x and y that might not always be the same on the same line  (for example, “x=2, y=1”)

D、 The program prints pairs of values for x and y that are always the same on the same line (forexample, “x=1, y=1”. In addition, each value appears twice (for example, “x=1, y=1” followed by  “x=1, y=1”)

E、 The program prints pairs of values for x and y that are always the same on the same line (for example, “x=1, y=1”. In addition, each value appears twice (for example, “x=1, y=1” followed by  “x=2s, y=2”)

答案
查看答案
相关试题

在Java语言中,不能注释多行内容的符号是()。

A、以//开始的注释

B、以/*开始,*/结束的注释

C、以/**开始,*/结束的注释

D、以上都不能

实例初始化块是在该类的构造方法之后执行的。

A、对

B、错

In your production database, data manipulation language (DML) operations are executed on theSALES table. You have noticed some dubious values in the SALES table during the last few days. Youare able to track users, actions taken, and the time of the action for this particular period but the changesin data are not tracked. You decide to keep track of both the old data and new data in the table along withthe user information.  What action would you take to achieve this task()

A、Apply fine-grained auditing.

B、Implement value-based auditing.

C、Impose standard database auditing to auditobject privileges.

D、Impose standard databaseauditing to audit SQL statements.

A user’s laptop does not produce sound even though the volume settings are at maximum in theoperating system. Which of the following would MOST likely resolve this issue?()

A、A new sound card

B、A new speaker

C、A BIOS update

D、A hardware volume control

Given the ActionEvent, which method allows you to identify the affected component?()

A、 GetClass.

B、 GetTarget.

C、 GetSource.

D、 GetComponent.

E、 GetTargetComponent.

最新解答的试题
提出现代生物-心理-社会医学模式是()

A.恩格尔B.波特C.托马斯·帕茨瓦尔D.比彻尔E.桑德斯
付款人在进行付款时无()

A.形式审查义务

B.实质审查义务

C.附带审查义务

D.票据外有关事项的审查义务
根据《公司法》的规定,有限责任公司下列人员中,可以提议召开股东会临时会议的是()。
A.总经理B.人数过半数的股东C.监事会主席D.人数为半数的董事
关于股份有限公司中的监事会,下列说法错误的是()

A.监事会负责提议聘请或更换外部审计机构B.监事会主席和副主席由全体监事过半数选举产生C.监事会中的职工代表的比例不得低于三分之一D.监事会应至少每6个月召开一次会议
三北精神的科学内涵