I have a file in path d:\input.txt I want get this path from user with Scanner class Here is my code but i recevie ArrayIndexOutOfBoundException Why?
if(args.length != 0)
{
readerWriter.readFile(args[0]);
}
else
{
System.out.println("Plese enter the path of your file");
Scanner filePath = new Scanner(System.in);
args[0] = filePath.next();
readerWriter.readFile(args[0]);
}