单选 软件与IT认证综合练习2026-06-29 更新 0 阅读

public class Foo implements Runnable (  public void run (Thread t) {   system.out.printIn(“Running.”);   }   public static void main (String args) {   new thread (new Foo()).start();   }   )   What is the result?()  

  1.  An exception is thrown.
  2.  The program exists without printing anything.
  3.  An error at line 1 causes compilation to fail. 正确答案
  4.  An error at line 6 causes the compilation to fail.
  5.  “Running” is printed and the program exits.
参考答案:C

本站整理,仅供学习参考