读程序,写出和程序输出格式一致的输出结果。
import java.io.RandomAccessFile;
public class J_Test {
public static void main(String[] args) throws Exception {
RandomAccessFile f = new RandomAccessFile(“a.txt”, “rw”);f.writeBoolean(true);
f.writeBoolean(false);
for(int i = 1; i < 10; ++i)
f.writeInt(i);
f.seek(6);
System.out.println(f.readInt());
f.close();
}
}
|
|