没有合适的资源?快使用搜索试试~ 我知道了~
Array index out of bound exception
共1个文件
java:1个
需积分: 25 0 下载量 116 浏览量
2014-06-03
03:04:01
上传
评论
收藏 423B RAR 举报
温馨提示
Write a program that first creates an integer array a[50], and set a[i] = i+3, i=0 to 49. The program next reads in an index k from the user, then calls a method readValue(int [ ] a, int k) that would return the value of a[k]. The main program displays the value a[k]. If the index is out of bounds, the method readValue(int [ ] a, int k) should throw an IndexOutOfBoundsException. The main program should catch the exception and display the message "out of bounds".
资源推荐
资源详情
资源评论
收起资源包目录
Main.rar (1个子文件)
Main.java 612B
共 1 条
- 1
资源评论
qq_16070311
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功