Whichcodefragmentswillsucceedinprintingthelastargumentgivenonthecommandlinetothestandardoutput,andexitgracefullywithnooutputifnoargumentsaregiven?()CODEFRAGMENTa:publicstaticvoidmain(Stringargs[]){if(args.length!=0)System.out.println(args[args.length-1]);}CODEFRAGMENTb:publicstaticvoidmain(Stringargs[]){try{System.out.println(args[args.length]);}catch(ArrayIndexOutOfBoundsExceptione){}}CODEFRAGMENTc:publicstaticvoidmain(Stringargs[]){intix=args.length;Stringlast=args[ix];if(ix!=0)System.out.println(last);}CODEFRAGMENTd:publicstaticvoidmain(Stringargs[]){intix=args.length-1;if(ix0)System.out.println(args[ix]);}CODEFRAGMENTe:publicstaticvoidmain(Stringargs[]){try{System.out.println(args[args.length-1]);}catch(NullPointerExceptione){}}
Whichcodefragmentswillsucceedinprintingthelastargumentgivenonthecommandlinetothestandardoutput,andexitgracefullywithnooutputifnoargumentsaregiven?()
CODEFRAGMENTa:
publicstaticvoidmain(Stringargs[]){
if(args.length!=0)
System.out.println(args[args.length-1]);
}
CODEFRAGMENTb:
publicstaticvoidmain(Stringargs[]){
try{System.out.println(args[args.length]);}
catch(ArrayIndexOutOfBoundsExceptione){}
}
CODEFRAGMENTc:
publicstaticvoidmain(Stringargs[]){
intix=args.length;
Stringlast=args[ix];
if(ix!=0)System.out.println(last);
}
CODEFRAGMENTd:
publicstaticvoidmain(Stringargs[]){
intix=args.length-1;
if(ix>0)System.out.println(args[ix]);
}
CODEFRAGMENTe:
publicstaticvoidmain(Stringargs[]){
try{System.out.println(args[args.length-1]);
}catch(NullPointerExceptione){}
}
相关考题:
4G238飞享套餐描述正确的是() A.500分钟国内主叫,1G国内流量,1G4G单模流量B.1000分钟国内主叫,1G国内流量,1G4G单模流量C.1000分钟国内主叫,2G国内流量,1G4G单模流量D.500分钟国内主叫,1G国内流量,400M4G单模流量
1000BaseT has a MAXIMUM run distance of:() A. 25 meters (82 feet)B. 100 meters (328 feet)C. 500 meters (1640 feet)D. 1000 meters (3280 feet)
在PowerPoint 2003中,设置幻灯片的切换效果可使用()命令。 A.视图菜单中的普通命令B.视图菜单中的幻灯片浏览命令C.视图菜单中的幻灯片放映命令D.视图菜单中的工具栏命令