Variable scope. Read about it. The "args" array only exists within the main method, since that is where it was declared (in the method header). If you want to use it from within your ReadFile method, then you had better declare ReadFile as taking a String[] as a parameter. But more likely what you actually want to do is this:
public static void main(String[] args)throws IOException
{
....
int sizeN = ReadFile(Onum, Snum, args[0]);
.....
}
public static int ReadFile( double[] Onum, double[] Snum, String fileName)throws IOException
{
Scanner fileScan = new Scanner(new File(fileName));
....
}
BestJewSinceJC
Posting Maven
2,772 posts since Sep 2008
Reputation Points: 874
Solved Threads: 354