多选题Given: String value = getServletContext().getInitParameter("foo"); in an HttpServlet and a web applicationdeployment descriptor that contains: foo frodo Which two are true?()AThe foo initialization parameter CANNOT be set programmatically.BCompilation fails because getInitParameter returns type Object.CThe foo initialization parameter is NOT a servlet initialization parameter.DCompilation fails because ServletContext does NOT have a getInitParameter method.EThe foo parameter must be defined within the  element of the deployment descriptor.

多选题
Given: String value = getServletContext().getInitParameter("foo"); in an HttpServlet and a web applicationdeployment descriptor that contains: foo frodo Which two are true?()
A

The foo initialization parameter CANNOT be set programmatically.

B

Compilation fails because getInitParameter returns type Object.

C

The foo initialization parameter is NOT a servlet initialization parameter.

D

Compilation fails because ServletContext does NOT have a getInitParameter method.

E

The foo parameter must be defined within the  element of the deployment descriptor.


参考解析

解析: 暂无解析

相关考题:

GiventheHttpServletcode:getServletContext().setAttribute(“foo”,“value”);Whatistheresult?() A.TheattributefooisplacedintheapplicationB.AServletContextListenerregisteredforthatservletisnotifiedC.AServletAttributeListenerregisteredforthatservletisnotifiedD.AnHttpSessionAttributeListenerregisteredforthatservletisnotified

Given:Stringvalue=getServletContext().getInitParameter(foo);inanHttpServletandawebapplicationdeploymentdescriptorthatcontains:context-paramparam-namefoo/param-nameparam-valuefrodo/param-value/context-paramWhichtwoaretrue?()A.ThefooinitializationparameterCANNOTbesetprogrammatically.B.CompilationfailsbecausegetInitParameterreturnstypeObject.C.ThefooinitializationparameterisNOTaservletinitializationparameter.D.CompilationfailsbecauseServletContextdoesNOThaveagetInitParametermethod.E.Thefooparametermustbedefinedwithintheelementofthedeploymentdescriptor.

FilterConfig的哪个方法可以返回init参数的名称?()A、getServletContext()B、getInitParameter(Stringname)C、getFilterName()D、getInitParameterNames()

public class test(  public static void main(string[]args){  string foo = args [1];  string foo = args [2];  string foo = args [3];  }  )  And command line invocation: Java Test red green blue   What is the result?()  A、 Baz has the value of “”B、 Baz has the value of nullC、 Baz has the value of “red”D、 Baz has the value of “blue”E、 Bax has the value of “green”F、 The program throws an exception.

int index = 1;   String test = new String;   String foo = test[index];  What is the result?()A、 Foo has the value “”B、 Foo has the value nullC、 An exception is thrownD、 The code will not compile

Which statements concerning the value of a member variable are true, when no explicit assignments have been made?()  A、The value of an int is undetermined.B、The value of all numeric types is zero.C、The compiler may issue an error if the variable is used before it is initialized.D、The value of a String variable is "" (empty string).E、The value of all object variables is null.

Given: String value = getServletContext().getInitParameter("foo"); in an HttpServlet and a web applicationdeployment descriptor that contains: foo frodo Which two are true?()A、The foo initialization parameter CANNOT be set programmatically.B、Compilation fails because getInitParameter returns type Object.C、The foo initialization parameter is NOT a servlet initialization parameter.D、Compilation fails because ServletContext does NOT have a getInitParameter method.E、The foo parameter must be defined within the  element of the deployment descriptor.

public class test(   public static void main(stringargs){   string foo = args [1];   string foo = args ;   string foo = args ;   }   )   And command line invocation:  Java Test red green blue  What is the result? () A、 Baz has the value of “”B、 Baz has the value of nullC、 Baz has the value of “red”D、 Baz has the value of “blue”E、 Bax has the value of “green”F、 The program throws an exception.

Which HttpSession method stores an object in a session?()A、 put(String name. Object value)B、 set(String name. Object value)C、 setAttribute(String name. Object value)D、 putAttribute(String name. Object value)E、 addAttribute(String name. Object value)

Given the following code:    public class Test {  void printValue(int m){  do {  System.out.println("The value is"+m);     }  while( --m  10 )     }  public static void main(String arg[]) {     int i=10;  Test t= new Test();     t.printValue(i);     }     }  Which will be output?()    A、 The value is 8B、 The value is 9C、 The value is 10D、 The value is 11

Given the HttpServlet code:   getServletContext().setAttribute(“foo”, “value”); What is the result?()A、 The attribute foo is placed in the applicationB、 A ServletContextListener registered for that servlet is notifiedC、 A ServletAttributeListener registered for that servlet is notifiedD、 An HttpSessionAttributeListener registered for that servlet is notified

int index = 1;  String [] test = new String[3];  String foo = test[index];     What is the result?()  A、 Foo has the value “”B、 Foo has the value nullC、 An exception is thrownD、 The code will not compile

Given:   12. NumberFormat nf = NumberFormat.getInstance();   13. nf.setMaximumFractionDigits(4);   14. nf.setMinimumFractionDigits(2);   15. String a = nf.format(3.1415926);   16. String b = nf.format(2);   Which two statements are true about the result if the default locale is Locale.US?()A、 The value of b is 2.00.B、 The value of a is 3.141.C、 The value of a is 3.14.D、 The value of b is 2.0000.E、 The value of a is 3.1415.F、 The value of a is 3.1416.G、 The value of b is 2.

Given: 12.String csv = "Sue,5,true,3"; 13.Scanner scanner = new Scanner( csv ); 14.scanner.useDelimiter(",");15. int age = scanner.nextInt(); What is the result?()A、Compilation fails.B、After line 15, the value of age is 5.C、After line 15, the value of age is 3.D、An exception is thrown at runtime.

单选题public class test(  public static void main(string[]args){  string foo = args [1];  string foo = args [2];  string foo = args [3];  }  )  And command line invocation: Java Test red green blue   What is the result?()A Baz has the value of “”B Baz has the value of nullC Baz has the value of “red”D Baz has the value of “blue”E Bax has the value of “green”F The program throws an exception.

单选题Which retrieves the value associated with “foo” from within an HttpServlet?()A  String value = getServletConfig( ).getParameter(“foo”);B  String value = getServletContext( ).getAttribute(“foo”);C  Object value = getServletContext( ).getInitParameter(“foo”);D  String value = getServletContext( ).getInitParameter(“foo”)

单选题public class test(   public static void main(stringargs){   string foo = args [1];   string foo = args ;   string foo = args ;   }   )   And command line invocation:  Java Test red green blue  What is the result? ()A Baz has the value of “”B Baz has the value of nullC Baz has the value of “red”D Baz has the value of “blue”E Bax has the value of “green”F The program throws an exception.

单选题Given: 1.package test; 2. 3.class Target { 4.public String name = "hello";5.} What can directly access and change the value of the variable name?()Aany classBonly the Target classCany class in the test packageDany class that extends Target

多选题Given:   12. NumberFormat nf = NumberFormat.getInstance();   13. nf.setMaximumFractionDigits(4);   14. nf.setMinimumFractionDigits(2);   15. String a = nf.format(3.1415926);   16. String b = nf.format(2);   Which two statements are true about the result if the default locale is Locale.US?()AThe value of b is 2.00.BThe value of a is 3.141.CThe value of a is 3.14.DThe value of b is 2.0000.EThe value of a is 3.1415.FThe value of a is 3.1416.GThe value of b is 2.

单选题Given: 1.package test; 2. 3.class Target { 4.public String name = "hello";5.} What can directly access and change the value of the variable name?()Aany classBonly the Target classCany class in the test packageDany class that extends Target

单选题You report to the IT department in your company that your computer has a connectivity problem. The department requests that you configure your system with the following value:  2001::f85c:494e:7:4bd4  You need to configure your computer accordingly.  What should you do?()AUse the given value as an IPv6 address.BUse the given value as a DNS suffix search item.CUse the given value as a WEP key for a wireless network.DUse the given value as a manually assigned MAC address.

单选题Given: 12.String csv = "Sue,5,true,3"; 13.Scanner scanner = new Scanner( csv ); 14.scanner.useDelimiter(",");15. int age = scanner.nextInt(); What is the result?()ACompilation fails.BAfter line 15, the value of age is 5.CAfter line 15, the value of age is 3.DAn exception is thrown at runtime.

多选题Given: String value = getServletContext().getInitParameter("foo"); in an HttpServlet and a web applicationdeployment descriptor that contains: foo frodo Which two are true?()AThe foo initialization parameter CANNOT be set programmatically.BCompilation fails because getInitParameter returns type Object.CThe foo initialization parameter is NOT a servlet initialization parameter.DCompilation fails because ServletContext does NOT have a getInitParameter method.EThe foo parameter must be defined within the  element of the deployment descriptor.

单选题Which HttpSession method stores an object in a session?()A put(String name. Object value)B set(String name. Object value)C setAttribute(String name. Object value)D putAttribute(String name. Object value)E addAttribute(String name. Object value)

单选题Given the HttpServlet code:   getServletContext().setAttribute(“foo”, “value”); What is the result?()A The attribute foo is placed in the applicationB A ServletContextListener registered for that servlet is notifiedC A ServletAttributeListener registered for that servlet is notifiedD An HttpSessionAttributeListener registered for that servlet is notified

单选题int index = 1;   String test = new String;   String foo = test[index];  What is the result?()A Foo has the value “”B Foo has the value nullC An exception is thrownD The code will not compile

单选题int index = 1;  String [] test = new String[3];  String foo = test[index];     What is the result?()A Foo has the value “”B Foo has the value nullC An exception is thrownD The code will not compile

单选题Given the following code:    public class Test {  void printValue(int m){  do {  System.out.println("The value is"+m);     }  while( --m  10 )     }  public static void main(String arg[]) {     int i=10;  Test t= new Test();     t.printValue(i);     }     }  Which will be output?()A The value is 8B The value is 9C The value is 10D The value is 11