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?()
- An exception is thrown.
- The program exists without printing anything.
- An error at line 1 causes compilation to fail. 正确答案
- An error at line 6 causes the compilation to fail.
- “Running” is printed and the program exits.
参考答案:C
本站整理,仅供学习参考