首页 试题广场 > 试题详情
单选题

阅读下列Java代码,运行后正确的输出结果是( )。
public class Test {
public void getNum(int[]arr,int i){
if(i<0||i>=arr.length)
System.out.println("索引不正确!");
else
System.out.println(arr[i]);
}
public static void main(String[] args) {
Test test=new Test();
int[] arr={25,36,77,99};
test.getNum(arr, 4);
}
}

  • A.99
  • B.索引不正确!
  • C.编译错误
提交并查看答案
下一题 上一题
Ke星伙伴们的回答/ 28个回答
关闭
关闭
QQ
交流群
邀请
好友
App
下载
意见
反馈
返回
顶部