运行其他的代码都能输出东西只有他不行
package ev10;
import java.util.Scanner;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.InputMismatchException;
import java.lang.String;public class Outperformance {
String []a= {"张三","李四","狗子","翠花","狗蛋"};
public void Out() throws IOException
{
try
{
FileOutputStream f=new FileOutputStream("data.txt");
Scanner in1=new Scanner(System.in);
int b[]=new int[5];
for(int j=0;j
{
b[j]=in1.nextInt();
if(0>=b[j]||b[j]>=100)
{
throw new Findexpection("成绩不能小于0也不能大于100!");
}
}
for(int i=0;i<a.length;i++)
{
System.out.println("姓名为"+a[i]+"的同学的成绩为"+b[i]);
f.write(b[i]);
}
f.close();
}
catch(InputMismatchException e)
{
System.err.println("输入的不为整数");
e.printStackTrace();
}
catch(Findexpection e)
{
System.err.println(e.getMessage());
}
}
public static void main(String[] args) throws IOException {
// TODO Auto-generated method stub
Outperformance o=new Outperformance();
o.Out();
System.out.print("456");
}
}
将o.O去掉就能输出456不去掉就什么都没有