2. public class Foo implements Runnable ( 3. public void run (Thread t) { 4. system.out.printIn(“Running.”); 5. } 6. public static void main (String[] args) { 7. new thread (new Foo()).start(); 8. ) 9. ) What is the result?() A、 An exception is thrown.B、 The program exists without printing anything.C、 An error at line 1 causes compilation to fail.D、 An error at line 6 causes the compilation to fail.E、 “Running” is printed and the program exits.
2. public class Foo implements Runnable ( 3. public void run (Thread t) { 4. system.out.printIn(“Running.”); 5. } 6. public static void main (String[] args) { 7. new thread (new Foo()).start(); 8. ) 9. ) What is the result?()
- A、 An exception is thrown.
- B、 The program exists without printing anything.
- C、 An error at line 1 causes compilation to fail.
- D、 An error at line 6 causes the compilation to fail.
- E、 “Running” is printed and the program exits.
相关考题:
1.class TestSuper { 22.TestSuper(int i) { } 3. } 4.class TestSub extends TestSuper{ } 5.class TestAll { 6.public static void main (String [] args) { 7.new TestSub(); 8.} 9.} Which is true?() A、 Compilation fails.B、 The code runs without exception.C、 An exception is thrown at line 7.D、 An exception is thrown at line 2.
1. public class A { 2. public void doit() { 3. } 4. public String doit() { 5. return “a”; 6. } 7. public double doit(int x) { 8. return 1.0; 9. } 10.} What is the result?() A、 An exception is thrown at runtime.B、 Compilation fails because of an error in line 7.C、 Compilation fails because of an error in line 4.D、 Compilation succeeds and no runtime errors with class A occur.
Which path, relative to a web application’s root, identifies the web application’s deployment descriptor?()A、 /conf/web.xmlB、 /WEB-INF/web.xmlC、 /conf/server.xmlD、 /META-INF/web.xmlE、 /WEB-INF/rules.xmlF、 /META-INF/server. Xml
String类的concat()方法与StringBuffer类的append()方法都可以连接两个字符串,它们之间有何不同?