帮忙找一下错误
提示: 作者被禁止或删除 内容自动屏蔽
public class RandomAccessTest { public static void main(String[] args) throws IOException { try { RandomAccessFile raf = new RandomAccessFile("d://data//wof.txt", "rw"); System.out.println("请输入20个整数"); int k[] = new int[20]; for (int i = 0; i < 20; i++) { /** System.out.println("输入第" + (i + 1) + "个"); BufferedReader br = new BufferedReader(new InputStreamReader( System.in)); String m = br.readLine(); k[i] = Integer.parseInt(m.trim()); System.out.println(k[i]); */ //raf.writeInt(k[i]); raf.writeInt(i);//不需要从键盘输入,直接输入就可以了 } raf.seek(12); while (true) { try { int r =(int) raf.readInt(); System.out.println(r); } catch (EOFException e) { break; } } } catch (RuntimeException e) { e.printStackTrace(); } catch (FileNotFoundException e) { e.printStackTrace(); } } }题目要求从该文件的第12个字节开始,而楼主是从第一个字节开始raf.seek(1);