class Computation extends Thread {  private int num;  private boolean isComplete;  private int result;  public Computation(int num) { this.num = num; }  public synchronized void run() {  result = num * 2;  isComplete = true;  notify();  }  public synchronized int getResult() {  while (!isComplete) {  try {  wait();  } catch (InterruptedException e) { }  }  return result;  }  public static void main(String[] args) {  Computation[] computations = new Computation [4];  for (int i = 0; i  computations.length; i++) {  computations[i] = new Computation(i);  computations[i] .start();  }  for (Computation c : computations)  System.out.print(c.getResult() +“ “);  }  }  What is the result?() A、 The code will deadlock.B、 The code may run with no output.C、 An exception is thrown at runtime.D、 The code may run with output “0 6”.E、 The code may run with output “2 0 6 4‟.F、 The code may ruin with output “0 2 4 6”.

class Computation extends Thread {  private int num;  private boolean isComplete;  private int result;  public Computation(int num) { this.num = num; }  public synchronized void run() {  result = num * 2;  isComplete = true;  notify();  }  public synchronized int getResult() {  while (!isComplete) {  try {  wait();  } catch (InterruptedException e) { }  }  return result;  }  public static void main(String[] args) {  Computation[] computations = new Computation [4];  for (int i = 0; i < computations.length; i++) {  computations[i] = new Computation(i);  computations[i] .start();  }  for (Computation c : computations)  System.out.print(c.getResult() +“ “);  }  }  What is the result?() 

  • A、 The code will deadlock.
  • B、 The code may run with no output.
  • C、 An exception is thrown at runtime.
  • D、 The code may run with output “0 6”.
  • E、 The code may run with output “2 0 6 4‟.
  • F、 The code may ruin with output “0 2 4 6”.

相关考题:

ext 怎么动态修改xtype Ext.extend(Ext.Window, {title: '任务查询',width: 900,height: 580,padding: 10,layout:'form',。。。的form怎麼提交,谢谢!

下面是Ext提供的日期控件的是()。 A.Ext.form.DateB.Ext.form.DateFieldC.Ext.form.TimeD.Ext.form.TimeField

下面能够制作进度条的是()。 A.Ext.MessageBox.alertB.Ext.MessageBox.showC.Ext.MessageBox.confimD.Ext.MessageBox.prompt

在做Ext的时候,下面哪个文件不是必须的()。 A.resources/css/ext-all.CssB.adapter/ext/ext-base.JsC.ext-debug.jsD.ext-all.js

下面不是创建一个Ext表格控件必须的项的是()。 A.Ext.grid.ColumnModuleB.Ext.data.StoreC.Ext.data.MemoryProxyD.Ext.grid.GridPanel

Linux不支持( )文件系统。A.NTFSB.SWAPC.EXT2D.EXT3

下面不是创建一个Ext表格控件必须的项的是()。A、Ext.grid.ColumnModuleB、Ext.data.StoreC、Ext.data.MemoryProxyD、Ext.grid.GridPanel

下面能够制作进度条的是()。A、Ext.MessageBox.alertB、Ext.MessageBox.showC、Ext.MessageBox.confimD、Ext.MessageBox.prompt

安装配置CG的Klinux操作系统时,/home文件系统使用以下哪个文件系统格式()。A、swapB、ext3C、ext2D、ext1

Linux系统中,一切皆为文件,Linux系统也有许多不同的文件类型,则下面不属于linux操作系统的文件系统类型的是()A、ext2B、ext3C、ext4D、ext8

Linux分区类型默认的是:()A、vfatB、ext2/ext3C、swapD、dos

在做Ext的时候,下面哪个文件不是必须的()。A、resources/css/ext-all.CssB、adapter/ext/ext-base.JsC、ext-debug.jsD、ext-all.js

A developer is creating a class Book that needs to access class Paper.The Paper class is deployed in a JARnamedmyLib.jar.Whichthree,taken independently,will allow the developer to use the Paper class while compiling the Book class?()A、The JAR fileis located at$JAVA_HOME/jre/classes/myLib.jar.B、The JAR fileis located at$JAVA_HOME/jre/lib/ext/myLib.jar.C、TheJ AR fileis located at/foo/myLib.jar and aclasspath environment variable is set that includes /foo/myLib.jar/Paper.class.D、The JAR fileis located at/foo/myLib.jar and a classpath environment variable is set that includes/foo/myLib.jar.E、The JAR file is located at/foo/myLib.jar and the Book class is compiled using javac-cp/foo/myLib.jar/Paper Book.java.F、The JAR file is located at/foo/myLib.jar and the Book class is compiled using javac-classpath/foo/myLib.jar Book.java.

我们讨论的计算思维中的计算一词,指英语中的()。A、computationB、computingC、computation and computingD、neither computation no computing

水力计算(shui li ji suan)hydraulic computation

光发射机消光比(Ext)的一般要求是()。A、Ext﹤10%B、Ext﹥10%C、Ext≤10%D、Ext≥10%

磁盘分区类型中,则下面不属于linux操作系统的文件系统类型的是()A、ext2B、ext3C、ext4D、ext8

ext2和ext3都是linux分区的类型

分区类型很多,除了ext2 ext3还有()分区类型A、ext2B、ext3C、ext4D、ext8

单选题在做Ext的时候,下面哪个文件不是必须的()。Aresources/css/ext-all.CssBadapter/ext/ext-base.JsCext-debug.jsDext-all.js

单选题By()computation, the seller estimated that the profit will be 5 %.AcoarseBcrudeCroughDrude

单选题class ClassA {  public int numberOfinstances;  protected ClassA(int numberOfinstances) {  this.numberOflnstances = numberOfinstances;  }  }  public class ExtendedA extends ClassA {  private ExtendedA(int numberOfinstances) {  super(numberOflnstances);  }  public static void main(String[] args) {  ExtendedA ext = new ExtendedA(420);  System.out.print(ext.numberOflnstances);  }  }  Which is true?()A 420 is the output.B An exception is thrown at runtime.C All constructors must be declared public.D Constructors CANNOT use the private modifier.E Constructors CANNOT use the protected modifier.

填空题Given the following code, write a line of code that, when inserted at the indicated location, will make the overriding method in Extension invoke the overridden method in class Base on the current object.   class Base {   public void print( ) {   System.out.println("base");   }   }   class Extention extends Base {   public void print( ) {   System.out.println("extension");   // insert line of implementation here   }   }   public class Q294d {   public static void main(String args[]) {   Extention ext = new Extention( );   ext.print( );   }   }   Fill in a single line of implementation.()

多选题A developer is creating a class Book that needs to access class Paper.The Paper class is deployed in a JARnamedmyLib.jar.Whichthree,taken independently,will allow the developer to use the Paper class while compiling the Book class?()AThe JAR fileis located at$JAVA_HOME/jre/classes/myLib.jar.BThe JAR fileis located at$JAVA_HOME/jre/lib/ext/myLib.jar.CTheJ AR fileis located at/foo/myLib.jar and aclasspath environment variable is set that includes /foo/myLib.jar/Paper.class.DThe JAR fileis located at/foo/myLib.jar and a classpath environment variable is set that includes/foo/myLib.jar.EThe JAR file is located at/foo/myLib.jar and the Book class is compiled using javac-cp/foo/myLib.jar/Paper Book.java.FThe JAR file is located at/foo/myLib.jar and the Book class is compiled using javac-classpath/foo/myLib.jar Book.java.

多选题A developer is creating a class Book, that needs to access class Paper. The Paper class is deployed in a JAR named myLib.jar. Which three, taken independently, will allow the developer to use the Paper class while compiling the Book class?()AThe JAR file is located at $JAVA_HOME/jre/classes/myLib.jar.BThe JAR file is located at $JAVA_HOME/jre/lib/ext/myLib.jar..CThe JAR file is located at /foo/myLib.jar and a classpath environment variable is set that includes /foo/myLib.jar/Paper.class.DThe JAR file is located at /foo/myLib.jar and a classpath environment variable is set that includes /foo/myLib.jar.EThe JAR file is located at /foo/myLib.jar and the Book class is compiled using javac -cp /foo/myLib.jar/Paper Book.java.FThe JAR file is located at /foo/myLib.jar and the Book class is compiled using javac -d /foo/myLib.jar Book.javaGThe JAR file is located at /foo/myLib.jar and the Book class is compiled using javac -classpath /foo/myLib.jar Book.java

问答题computation与computing有何差别,有何类似?

多选题A developer is creating a class Book, that needs to access class Paper. The Paper class is deployed in a JAR named myLib.jar. Which three, taken independently, will allow the developer to use the Paper class while compiling the Book class?()AThe JAR file is located at $JAVA_HOME/jre/classes/myLib.jarBThe JAR file is located at $JAVA_HOME/jre/lib/ext/myLib.jarCThe JAR file is located at /foo/myLib.jar and a classpath environment variable is set that includes /foo/myLib.jar/Paper.classDThe JAR file is located at /foo/myLib.jar and a classpath environment variable is set that includes /foo/myLib.jarEThe JAR file is located at /foo/myLib.jar and the Book class is compiled using javac –cp /foo/myLib.jar/Paper Book.javaFThe JAR file is located at foo/myLib.jar and the Book class is compiled using javac –classpath /foo/myLib.jar Book.java

单选题class Computation extends Thread {  private int num;  private boolean isComplete;  private int result;  public Computation(int num) { this.num = num; }  public synchronized void run() {  result = num * 2;  isComplete = true;  notify();  }  public synchronized int getResult() {  while (!isComplete) {  try {  wait();  } catch (InterruptedException e) { }  }  return result;  }  public static void main(String[] args) {  Computation[] computations = new Computation [4];  for (int i = 0; i  computations.length; i++) {  computations[i] = new Computation(i);  computations[i] .start();  }  for (Computation c : computations)  System.out.print(c.getResult() +“ “);  }  }  What is the result?()A The code will deadlock.B The code may run with no output.C An exception is thrown at runtime.D The code may run with output “0 6”.E The code may run with output “2 0 6 4‟.F The code may ruin with output “0 2 4 6”.