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
答案解析:有
微信扫一扫手机做题