Can anyone help me on this issue?
'public class DataBase {
static Article[] arts;
public static int FileNumber;
public static String[] FileList;
static File root;
public DataBase(String ID, String TA)
{
File root=new File(pth);
FileList=root.list().length;
String[] FileList=new String[FileNumber];
for(int i=0;i<FileNumber;i++)
{
FileList[i]=new String(root.list()[i]);
}
arts=new Article[FileNumber];
}
public void phase_0() //Initializare lista articole
{
for(int i=0;i<FileNumber;i++)
{
System.out.println(FileList[i]); ******
}
}
}'
I get runtime error at the line marked with **. I don't have any idea about the issue. Can somebody help?
To be clarified, in static void main i first use constructor
DataBase db=new DataBase(...)
and then
db.phase_0();
and i get at the error on this last method at the specified line. Thanx in advance! The PATH is inserted when necessary, I assure that is NOT the problem
public static int FileNumber;should bepublic static int FILE_NUMBER;public static int fileNumber;