求高手点拨:“一个Java程序中的小错误”的错误原因....
高手,您好:
我是一名学习软件工程的学生,今天在调试程序的时候,我发现了一个错误:
错误类的代码截图如下:
错误类的代码如下:
package c_port_package;
import java.io.File;
import java.net.Socket;
public class TheSyslegalUserConfirm{
static String MyOrderNum = null;
static int i = 0;
static int j = 0;
Socket so1 = null;
File file1 = new File("C:\\");
File file2 = new File("D:\\");
File file3 = new File("E:\\");
File file4 = new File("D:\\");
static File[] fileArray0 = new File[i];
static File[] fileArray1 = new File[j];
String[] commonfruit = null;
String[] videofruit = null;
static String sector = null;
CheckAndConfirmworker checkworker = new CheckAndConfirmworker();
public TheSyslegalUserConfirm(){
CheckAndConfirmworker.findthecommonfruit(file1);
CheckAndConfirmworker.findthevideofruit(file1);
CheckAndConfirmworker.findthecommonfruit(file2);
CheckAndConfirmworker.findthevideofruit(file2);
CheckAndConfirmworker.findthecommonfruit(file3);
CheckAndConfirmworker.findthevideofruit(file3);
CheckAndConfirmworker.findthecommonfruit(file4);
CheckAndConfirmworker.findthevideofruit(file4);
i = commonfruit.length;
j = videofruit.length;
for(int x=0;x<commonfruit.length;x++){
fileArray0[x] = new File(commonfruit[x]);
}
for(int y=0;y<videofruit.length;y++){
fileArray1[y] = new File(videofruit[y]);
}
}
}
其中的“CheckAndConfirmworker”类的类头的截图如下:
其中的“CheckAndConfirmworker”类的第22行的出错的方法“findthecommonfruit(file)”,的方法定义的方法头的截图内容如下:
这里的“CheckAndConfirmworker”类文件的代码如下:
package c_port_package;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
public class CheckAndConfirmworker {
static C_port_Our_honor fileDS = null;
HashMap<String,String> fileset = null;
static ArrayList<String> thecommonfruitPath = new ArrayList<String>();
static ArrayList<String> thevideofruitPath = new ArrayList<String>();