A programmer needs to create a logging method that can accep

题目
单选题
A programmer needs to create a logging method that can accept an arbitrary number of arguments. For example, it may be called in these ways:  logIt(”log message 1 “);  logIt(”log message2”,”log message3”);  logIt(”log message4”, “log message5”, “log message6);  Which declaration satisfies this requirement?()
A

 public void logIt(String * msgs)

B

 public void logIt(String [] msgs)

C

 public void logIt(String... msgs)

D

 public void logIt(String msg1, String msg2, String msg3)

如果没有搜索结果或未解决您的问题,请直接 联系老师 获取答案。
相似问题和答案

第1题:

In object-oriented(51), objects can be viewed as reusable components, and once the programmer has developed a(52)of these components, he can(53)the amount of new coding required. But(52)a(54)is no simple task because the integrity of the Original software design is critical. Reusability can be a mixed blessing for user, too, as a programmer has to be able to find the object he needs. But if(55)is your aim, reusability is worth the risk.

A.programming

B.creating

C.indisposing

D.library

E.maximize


正确答案:A

第2题:

Which can appropriately be thrown by a programmer using Java SE technology to create a desktop application?()

  • A、ClassCastException
  • B、NullPointerException
  • C、NoClassDefFoundError
  • D、NumberFormatException
  • E、ArrayIndexOutOfBoundsException

正确答案:D

第3题:

A programmer needs to create a logging method that can accept an arbitrary number of arguments.Forexample,it may be called in these ways:logIt("log message 1");logIt("log message 2”,”log message 3");logIt("log message 4","log message 5","log message 6");Which declaration satisfies this requirement()?

A.public void logIt(String*msgs)

B.public void logIt(String[]msgs)

C.public void logIt(String...msgs)

D.public voidl ogIt(Stringmsg1,Stringmsg2,Stringmsg3)


参考答案:C

第4题:

In your web application,you need to execute a block of code whenever the session object is first created. Which design will accomplish this goal?()

  • A、Create an HttpSessionListener class and implement the sessionInitialized method with that block ofcode.
  • B、Create an HttpSessionActivationListener class and implement the sessionCreated method with thatblock of code.
  • C、Create a Filter class, call the getSession(false) method, and if the result was null, then execute that block of code.
  • D、Create an HttpSessionListener class and implement the sessionCreated method with that block of code.

正确答案:D

第5题:

A JSP page needs to perform some operations before servicing the first request. Where can this be done?()

  • A、 within a method called jspInit
  • B、 within the page directive of the JSP page
  • C、 within a scriptlet at the top of the JSP page
  • D、 within the  XML element

正确答案:A

第6题:

public interface A {  String DEFAULT_GREETING = “Hello World”;  public void method1();  }  A programmer wants to create an interface called B that has A as its parent. Which interface declaration is correct?() 

  • A、 public interface B extends A {}
  • B、 public interface B implements A {}
  • C、 public interface B instanceOf A {}
  • D、 public interface B inheritsFrom A {}

正确答案:A

第7题:

A client has a temporary deployment of a new static application that needs to run for a short period of time and is not going to change. How can this deployment be achieved with a minimum of effort and time?()

  • A、Run a system WPAR and deploy the application.
  • B、Create a new LPAR and deploy the application.
  • C、Create an application WPAR to deploy the application.
  • D、Create an LPAR hosted by a VIO server and deploy the application.

正确答案:C

第8题:

A client has a temporary deployment of a new static application that needs to run for a short period of time and is not going to change.How can this deployment be achieved with a minimum of effort and time?()

A.Run a system WPAR and deploy the application.

B.Create a new LPAR and deploy the application.

C.Create an application WPAR to deploy the application.

D.Create an LPAR hosted by a VIO server and deploy the application.


参考答案:C

第9题:

Your web application requires the adding and deleting of many session attributes during a complex usecase. A bug report has come in that indicates that an important session attribute is being deleted too soonand a NullPointerException is being thrown several interactions after the fact. You have decided to create asession event listener that will log when attributes are being deleted so you can track down when theattribute is erroneously being deleted. Which listener class will accomplish this debugging goal?()

  • A、Create an HttpSessionAttributeListener class and implement the attributeDeleted method and log the attribute name using the getName method on the event object.
  • B、Create an HttpSessionAttributeListener class and implement the attributeRemoved method and log the attribute name using the getName method on the event object.
  • C、Create an SessionAttributeListener class and implement the attributeRemoved method and log the attribute name using the getAttributeName method on the event object.
  • D、Create an SessionAttributeListener class and implement the attributeDeleted method and log the attribute name using the getAttributeName method on the event object.

正确答案:B

第10题:

You are creating a Windows Communication Foundation (WCF) service that implements the following service contract.[ServiceContract]public interface IOrderProcessing { [OperationContract] void ApproveOrder(int id);}You need to ensure that only users with the Manager role can call the ApproveOrder method. What should you do?()

  • A、In the method body, check the Rights PosessesProperty property to see if it contains Manager
  • B、Add a PrincipalPermission attribute to the method and set the Roles property to Manager
  • C、Add a SecurityPermission attribute to the method and set the SecurityAction to Demand
  • D、In the method body, create a new instance of WindowsClaimSet. Use the FindClaims method to locate a claimType named Role with a right named Manager

正确答案:B

更多相关问题