black

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)

相关考题

多项选择题 10.publicclassBar{ 11.staticvoidfoo(int...x){ 12.//insertcodehere 13.} 14.} Which two code fragments,inserted independently at line1 2,will allow the class to compile()

单项选择题 String[] elements={"for","tea","too"}; String first=(elements.length>0)?elements[0]null; What is the result?()

单项选择题 11.public static void main(String[]args){ 12.Object obj=new int[]{1,2,3}; 13.int[] someArray=(int[])obj; 14.for(inti:someArray)System.out.print(i+"") 15.} What is the result?()

All Rights Reserved 版权所有©PP题库网库(pptiku.com)

备案号:湘ICP备14005140号-5

经营许可证号:湘B2-20140064