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、 BB、 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 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.

相关考题:

Which two code fragments correctly create and initialize a static array of int elements() A.static final int[]a={100,200};B.static final int[]a;static{a=new int[2];a[0]=100;a[1]=200;}C.static final int[]a=new int[2]{100,200};D.static final int[]a;static void int(){a=new int[3];a[0]=100;a[1]=200;}

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.countB、 args.lengthC、 args.count()D、 args.length()E、 args.getLength()

Which two code fragments correctly create and initialize a static array of int elements()A、static final int[]a={100,200};B、static final int[]a;static{a=new int[2];a[0]=100;a[1]=200;}C、static final int[]a=new int[2]{100,200};D、static final int[]a;static void int(){a=new int[3];a[0]=100;a[1]=200;}

在C#程序中.入口函数的正确声明为:()A、static int main(){……}B、static void main(){……}C、static void Main(){……}D、static main(){……}

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.

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.

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、 42B、 0042C、 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.

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、 BD、 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.

单选题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 42B 0042C 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.

单选题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.countB args.lengthC args.count()D args.length()E args.getLength()

单选题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 BB 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.

单选题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行,可以编译?()A0B1C3D4

单选题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 BB 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.

单选题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?()AApply an import policy to OSPF that injects the static routes into OSPFBApply an import policy to the static routes that injects the static routes into OSPFCApply an export policy to the static routes that injects the static routes into OSPFDApply an export policy to OSPF that injects the static routes into OSPF

多选题Which statements about static inner classes are true?()AA static inner class requires a static initializer.BA static inner class requires an instance of the enclosing class.CA static inner class has no reference to an instance of the enclosing class.DA static inner class has access to the non-static members of the outer class.EStatic members of a static inner class can be referenced using the class name of the static inner  class.

单选题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.

多选题10. class Foo {  11. static void alpha() { /* more code here */ }  12. void beta() { /* more code here */ }  13. }  Which two are true?()AFoo.beta() is a valid invocation of beta().BFoo.alpha() is a valid invocation of alpha().CMethod beta() can directly call method alpha().DMethod alpha() can directly call method beta().

多选题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?()AThe function method must have the signature: public String spin().BThe method must be mapped to the logical name spin in the web.xml file.CThe function method must have the signature: public String spinIt().DThe function method must have the signature public static String spin().EThe function method must have the signature: public static String spinIt().FThe function class must be named Spinner, and must be in the package com.example.

填空题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?()

单选题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.