Java 扫描仪可以用来写入文件吗?
我有以下代码片段Java 扫描仪可以用来写入文件吗?,java,android,java.util.scanner,Java,Android,Java.util.scanner,我有以下代码片段 /* I have got the file. Now moving to the desired place */ Scanner in_chap = new Scanner(chap); in_chap.useDelimiter(qa_delimiter); while (in_chap.hasNext()) { String str = get_my_info(); /* Now I need to replace the the
/* I have got the file. Now moving to the desired place */
Scanner in_chap = new Scanner(chap);
in_chap.useDelimiter(qa_delimiter);
while (in_chap.hasNext()) {
String str = get_my_info();
/* Now I need to replace the the current line with str */
}
有没有办法使用scanner引用将str写入新的偏移量?如果我不能,还有别的办法吗?我需要用扫描器才能到达那条线。现在我想用新字符串替换它…不,正如名字所说,它是一个
扫描仪,它只用于阅读,不用于写作
有没有办法使用scanner引用将str写入新的偏移量
否。扫描仪
类仅用于阅读。没有扫描仪对象仅用于输入。否<代码>扫描仪
提供只读访问。@pst:(提前了几分之一秒!)