Hello all,
I want to ask you what this code mean.
import java.io.*;
class CopyFile {
public static void main(String[] args) throws IOException{
int i;
FileReader fin; FileWriter fout;
try {
fin = new FileReader(args[0]);
fout = new FileWriter(args[1]);
}
catch (FileNotFoundException e) {
System.out.println("Error opening output file.");
return; //what the meaning of this line?
}
catch (IndexOutOfBoundsException e) {
System.out.println("Usage: CopyFile from .. to ..");
return; //what the meaning of this line?
}
try {
do {
i = fin.read();
if (i!=-1)
fout.write(i);
} while (i!= -1);
}
catch (IOException e) {
System.out.println("File error.");
}
finally{
try{
if (fin!=null) fin.close();
if (fout!=null) fout.close();
}
catch(IOException e){
System.out.println(e.getMessage());
}
}
}
}
As I know, return keyword is usually followed by a return value.
Can you explain what is the meaning of that line?
Thanks in advance