11. static class A {  12. void process() throws Exception { throw new Exception(); }  13. }  14. static class B extends A {  15. void process() { System.out.println(”B”); }  16. }  17. public static void main(String[] args) {  18. new B().process();  19.

题目

11. static class A {  12. void process() throws Exception { throw new Exception(); }  13. }  14. static class B extends A {  15. void process() { System.out.println(”B”); }  16. }  17. public static void main(String[] args) {  18. new B().process();  19. }  What is the result?() 

  • A、 B
  • B、 The code runs with no output.
  • C、 Compilation fails because of an error in line 12.
  • D、 Compilation fails because of an error in line 15.
  • E、 Compilation fails because of an error in line 18.

相似考题
更多“11. static class&ensp”相关问题
  • 第1题:

    Which statements about static inner classes are true?()

    • A、 A static inner class requires a static initializer.
    • B、 A static inner class requires an instance of the enclosing class.
    • C、 A static inner class has no reference to an instance of the enclosing class.
    • D、 A static inner class has access to the non-static members of the outer class.
    • E、 Static members of a static inner class can be referenced using the class name of the static inner  class.

    正确答案:C,E

  • 第2题:

    11. public static void append(List list) { list.add(”0042”); }  12. public static void main(String[] args) {  13. List intList = new ArrayList();  14. append(intList);  15. System.out.println(intList.get(0));  16. }  What is the result?() 

    • A、 42
    • B、 0042
    • C、 An exception is thrown at runtime.
    • D、 Compilation fails because of an error in line 13.
    • E、 Compilation fails because of an error in line 14.

    正确答案:B

  • 第3题:

    单选题
    11. public static void append(List list) { list.add(”0042”); }  12. public static void main(String[] args) {  13. List intList = new ArrayList();  14. append(intList);  15. System.out.println(intList.get(0));  16. }  What is the result?()
    A

     42

    B

     0042

    C

     An exception is thrown at runtime.

    D

     Compilation fails because of an error in line 13.

    E

     Compilation fails because of an error in line 14.


    正确答案: B
    解析: 暂无解析

  • 第4题:

    单选题
    11. static class A {  12. void process() throws Exception { throw new Exception(); }  13. }  14. static class B extends A {  15. void process() { System.out.println(”B”); }  16. }  17. public static void main(String[] args) {  18. new B().process();  19. }  What is the result?()
    A

     B

    B

     The code runs with no output.

    C

     Compilation fails because of an error in line 12.

    D

     Compilation fails because of an error in line 15.

    E

     Compilation fails because of an error in line 18.


    正确答案: E
    解析: 暂无解析

  • 第5题:

    单选题
    11. static classA {  12. void process() throws Exception { throw new Exception(); }  13. }  14. static class B extends A {  15. void process() { System.out.println(”B “); }  16. }  17. public static void main(String[] args) {  18.A a=new B();  19. a.process();  20.}  What is the result?()
    A

     B

    B

     The code runs with no output.

    C

     An exception is thrown at runtime.

    D

     Compilation fails because of an error in line 15.

    E

     Compilation fails because of an error in line 18.

    F

     Compilation fails because of an error in line 19.


    正确答案: E
    解析: 暂无解析

  • 第6题:

    多选题
    Which statements about static inner classes are true?()
    A

    A static inner class requires a static initializer.

    B

    A static inner class requires an instance of the enclosing class.

    C

    A static inner class has no reference to an instance of the enclosing class.

    D

    A static inner class has access to the non-static members of the outer class.

    E

    Static members of a static inner class can be referenced using the class name of the static inner  class.


    正确答案: C,E
    解析: 暂无解析

  • 第7题:

    多选题
    10. class Foo {  11. static void alpha() { /* more code here */ }  12. void beta() { /* more code here */ }  13. }  Which two are true?()
    A

    Foo.beta() is a valid invocation of beta().

    B

    Foo.alpha() is a valid invocation of alpha().

    C

    Method beta() can directly call method alpha().

    D

    Method alpha() can directly call method beta().


    正确答案: B,A
    解析: 暂无解析

  • 第8题:

    填空题
    1. public class test {  2. public static string output = “”  3.    4. public static void foo(int i) {  5. try {  6. if(i= =1) {  7. throw new Exception ();  8. }  9. output += “1”;  10.}  11. catch(Exception e)  {  12. output += “2”;  13. return;  14.}  15. finally (  16. output += “3”;  17. )  18. output += “4”;  19. } 20.    21. public static void main (string args[])  (  22. foo(0);  23. foo(1);  24.    25. )  26. } What is the value of the variable output at line 24?()

    正确答案: 13423
    解析: 暂无解析

  • 第9题:

    Given an EL function declared with:11.  12.spin 13.com.example.Spinner 14. 15.java.lang.String spinIt() 16. 17. Which two are true?()

    • A、The function method must have the signature: public String spin().
    • B、The method must be mapped to the logical name "spin" in the web.xml file.
    • C、The function method must have the signature: public String spinIt().
    • D、The function method must have the signature public static String spin().
    • E、The function method must have the signature: public static String spinIt().
    • F、The function class must be named Spinner, and must be in the package com.example.

    正确答案:E,F

  • 第10题:

    Given:   11. static class A {   12. void process() throws Exception { throw new Exception(); }   13. }   14. static class B extends A {   15. void process() { System.out.println("B "); }   16. }   17. public static void main(String[] args) {   18. A a = new B();   19. a.process();   20. }   What is the result? ()

    • A、 Compilation fails because of an error in line 19.
    • B、 An exception is thrown at runtime.
    • C、 B
    • D、 Compilation fails because of an error in line 18.
    • E、 Compilation fails because of an error in line 15. 
    • F、 The code runs with no output.

    正确答案:A

  • 第11题:

    单选题
    11. public class Counter {  12. public static void main(String[] args) {  13. int numArgs = /* insert code here */;  14. }  15. }  and the command line: java Counter one fred 42 Which code, inserted at line 13, captures the number of arguments passed into the program?()
    A

     args.count

    B

     args.length

    C

     args.count()

    D

     args.length()

    E

     args.getLength()


    正确答案: C
    解析: 暂无解析

  • 第12题:

    单选题
    1. class Passer2 {   2. //insert code here   3. static int bigState = 42;   4. public static void main(String [] args) {   5. bigState = p2.go(bigState);   6. System.out.print(bigState);   7. }   8. int go(int x) {   9. return ++x;   10. }   11. }  和4段代码片段:  static Passer2 p2 = new Passer2();  final static Passer2 p2 = new Passer2();  private static Passer2 p2 = new Passer2();  final private static Passer2 p2 = new Passer2();  有多少行分别插入到第2行,可以编译?()
    A

    0

    B

    1

    C

    3

    D

    4


    正确答案: C
    解析: 暂无解析

  • 第13题:

    单选题
    There are three static routes in the routing table that need to be announced to your OSPF preers. Which method is used to accomplish this?()
    A

    Apply an import policy to OSPF that injects the static routes into OSPF

    B

    Apply an import policy to the static routes that injects the static routes into OSPF

    C

    Apply an export policy to the static routes that injects the static routes into OSPF

    D

    Apply an export policy to OSPF that injects the static routes into OSPF


    正确答案: D
    解析: 暂无解析

  • 第14题:

    单选题
    1. public class X {  2. public static void main (String[]args)   {  3. int [] a = new int [1]  4. modify(a);  5. System.out.printIn(a[0]);  6. }  7.    8. public static void modify (int[] a)  {  9.   a[0] ++;  10.    } 11. }       What is the result?()
    A

     The program runs and prints “0”

    B

     The program runs and prints “1”

    C

     The program runs but aborts with an exception.

    D

     An error “possible undefined variable” at line 4 causes compilation to fail.

    E

     An error “possible undefined variable” at line 9 causes compilation to fail.


    正确答案: E
    解析: 暂无解析

  • 第15题:

    多选题
    Given an EL function declared with:11.  12.spin 13.com.example.Spinner 14. 15.java.lang.String spinIt() 16. 17. Which two are true?()
    A

    The function method must have the signature: public String spin().

    B

    The method must be mapped to the logical name spin in the web.xml file.

    C

    The function method must have the signature: public String spinIt().

    D

    The function method must have the signature public static String spin().

    E

    The function method must have the signature: public static String spinIt().

    F

    The function class must be named Spinner, and must be in the package com.example.


    正确答案: E,F
    解析: 暂无解析

  • 第16题:

    单选题
    Which statement about static inner classes is true? ()
    A

     An anonymous class can be declared as static.

    B

     A static inner class cannot be a static member of the outer class.

    C

     A static inner class does not require an instance of the enclosing class.

    D

     Instance members of a static inner class can be referenced using the class name of the static inner class.


    正确答案: D
    解析: 暂无解析