What happens if the file test.dat does not exist when you attempt to compile and run the following code?
import java.io.*;
public class Test {public static void main(String[] args) {
try ( RandomAccessFile raf =
new RandomAccessFile("test.dat", "r"); ) {
int i = raf.readInt();
}
catch (IOException ex) {
System.out.println("IO exception");
}
}
}
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.