关于异常的一个问题,求高手。。 int [] arr=new int[31]; 数组被初始化为31个0然后c.arr(arr,4)由于index<0不成立,所以直接返回arr[4]然后呢?没有打印语句,控制台当然不会有显示啦 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 class FushuIndexException extends Exception{ FushuIndexException(String a) { super(a); }}class method{ public int arr(int[] arr, int index) throws FushuIndexException { if (index < 0) { throw new FushuIndexException("我学会啦~"); } return arr[index]; }}class Cn{ public static void main(String[] args) throws FushuIndexException { int[] arr = new int[31]; method c = new method(); System.out.println(c.arr(arr, 4)); //打印语句 }} 如何用Java将.csv文件导入到Access2007 请帮忙下载一个资源,谢谢~~ 想跟大家一起讨论下钩子函数的问题 关于import的问题 JAVA新手的困惑 请问JTextField 和TextField有什么区别? 怎么在一个frame上放20个panel?? 怎么让我的applet显示在网页上?高分! 控件的定位/鼠標指針隱藏(Applet) 我的网页中的applet不对吗 nio的疑问,请大牛指教 关于类的引用
{ FushuIndexException(String a)
{
super(a);
}}class method
{
public int arr(int[] arr, int index) throws FushuIndexException
{
if (index < 0)
{
throw new FushuIndexException("我学会啦~");
}
return arr[index];
}}class Cn
{
public static void main(String[] args) throws FushuIndexException
{
int[] arr = new int[31];
method c = new method();
System.out.println(c.arr(arr, 4)); //打印语句 }
}