请问为什么我这个程序无法运行? Exception 怎么出来的呀,和怎么一些东西,如:方法等,很乱呀,整理一下 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 你少了几个}符号,我给你改了一下。可以了。class tryarray{ static float c; public static void main(String args[]) { BufferedReader readin=new BufferedReader(new InputStreamReader(System.in)); float a[]={1F,5.6F,7F,0F,6F}; float b[]={3F,5F,7F,8F}; do{ try { System.out.println("Do NOT Exit Y"); String input3=readin.readLine(); if(!input3.toUpperCase().equals("Y")) { System.exit(0); } int i; for(i=0;i<4;i++) System.out.println("Resolt N1/N2= "+division(a[i],b[i])); } catch(IOException e) {System.out.println(e);} catch(NumberFormatException e) {System.out.println(e);} catch(ArithmeticException e) { System.out.println("error!"); System.out.println(e); e.printStackTrace(System.out); } catch(IndexOutOfBoundsException e) { System.out.println("array over");} finally { System.out.println("continue"); } }while(true); } static float division(float a1,float a2) throws ArithmeticException { if(a2==0) throw new ArithmeticException("can't be 0"); float k; k=a1/a2; return k; }} tryarray.java(6,5) : error J0049: Undefined name 'BufferedReader'tryarray.java(6,5) : error J0044: Cannot find definition for class 'BufferedReader'tryarray.java(22,13) : error J0049: Undefined name 'IOException'tryarray.java(22,13) : error J0044: Cannot find definition for class 'IOException' import java.io.*;还是要的. 我想用 jTable 表格一次性存储多行数据到数据库 ,请帮忙,谢谢! Panel用法 ★★★★★如果对Java代码进行可订制裁减★★★★★ java中一个简单问题 关于使用包的servlet 请教:左、中、右三部分分隔(宽度不同)的布局如何实现? 关于jbuilder的简单问题 有谁知道jbuilder7的序列号和注册码呢 看看这个问题怎么办 比较两个List把不同的值取出来,contains无效! 明天我上汇报课,有朋友给点鼓励吗/ 如何用JAVA实现类似于微软的IP输入框的输入框
class tryarray
{
static float c;
public static void main(String args[])
{
BufferedReader readin=new BufferedReader(new InputStreamReader(System.in));
float a[]={1F,5.6F,7F,0F,6F};
float b[]={3F,5F,7F,8F};
do{
try
{
System.out.println("Do NOT Exit Y");
String input3=readin.readLine();
if(!input3.toUpperCase().equals("Y"))
{
System.exit(0);
}
int i;
for(i=0;i<4;i++)
System.out.println("Resolt N1/N2= "+division(a[i],b[i]));
}
catch(IOException e)
{System.out.println(e);}
catch(NumberFormatException e)
{System.out.println(e);}
catch(ArithmeticException e)
{
System.out.println("error!");
System.out.println(e);
e.printStackTrace(System.out);
}
catch(IndexOutOfBoundsException e)
{ System.out.println("array over");}
finally
{
System.out.println("continue");
} }while(true);
}
static float division(float a1,float a2) throws ArithmeticException
{
if(a2==0) throw new ArithmeticException("can't be 0");
float k;
k=a1/a2;
return k;
}
}
tryarray.java(6,5) : error J0044: Cannot find definition for class 'BufferedRead
er'
tryarray.java(22,13) : error J0049: Undefined name 'IOException'
tryarray.java(22,13) : error J0044: Cannot find definition for class 'IOExceptio
n'
还是要的.