Problem: I don't know how to appropriately call the method like the assignment instructs me to.
Objective:
Within the main method, call the readFile
method with the first command line argument (args[0]
), then call the writeFile
method with the second command line argument (args[1]
).
What I've tried:
public static void main(String[] args)
{
if(args.length == 0)
{
inputFile = FileIO(args[0]);
}
if(args.length == 1)
{
outputFile = FileIO(args[1]);
}
}
Code to work with:
public class FileIO {
public void readFile(String inputFile)
{
}
public void writeFile(String outputFile)
{
}
public static void main(String[] args)
{
}
}
Error:
Multiple markers at this line
-inputFile cannot be resolved to a variable
-The method FileIO(String) is undefined for the type FileIO