Why am I getting an ArrayIndexOutOfBoundsException in my code?
<p>Why am I getting java.lang.ArrayIndexOutOfBoundsException :0 at CopyFile.main

<pre><code>//Copy one file Data to another File
import java.io.*;

class CopyFile{

        public static void main(String[] args)throws IOException{
            FileInputStream fis=new FileInputStream(args[0]);//reading File 
            FileOutputStream fos=new FileOutputStream(args[1]);//reading File
            int data;

            while((data=fis.read())!=-1){
                fos.write(data);
/*here  using while loop to copy data from one file and storing it in another file*/
            }
        }
}
</code></pre>
