Exception 关于从文本文件生成数据的问题和例外

Exception 关于从文本文件生成数据的问题和例外,exception,Exception,我试图编写一个代码,在其中我从文本文件中删除数据,并不断得到一个错误“unhandled exception-FileNotFoundException”。我试图抛出一些异常,但它仍然会给我错误。以下是相关代码: 导入java.util。; 导入java.io 公共类数据行{ int numIndepVars; int numRows; double yValues; double[] xValues; ArrayList<String> readList; File file =

我试图编写一个代码,在其中我从文本文件中删除数据,并不断得到一个错误“unhandled exception-FileNotFoundException”。我试图抛出一些异常,但它仍然会给我错误。以下是相关代码:

导入java.util。; 导入java.io

公共类数据行{

int numIndepVars;
int numRows;
double yValues;
double[] xValues;
ArrayList<String> readList;
File file = new File("C:\\Users\\philly\\eclipse-workspace\\CSC- 
240\\src\\HomeworkPrpblems\\values.txt");
Scanner sc = new Scanner(file);
int numIndepVars;
int numRows;
双Y值;
双[]x值;
ArrayList可读列表;
File File=新文件(“C:\\Users\\philly\\eclipse workspace\\CSC-
240\\src\\HomeworkPrpblems\\values.txt”);
扫描仪sc=新扫描仪(文件);