多做题,通过考试没问题!

Java认证考试

睦霖题库>其他计算机考试>Java认证考试

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
答案解析:
进入题库查看解析

微信扫一扫手机做题