我有两个类(writeArray和readArray),它们应该写一个{10,20,30}的数组,并在演示类中打印它,但它只打印出10个,没有20或30,而我没有了解它是否无法读取整个数组,或者我的演示代码是否有问题。
这是数组类:
function myfunction_show_hide(){
$(this).next().toggle();
这是显示类:
function myfunction_hide(){
$(this).prev().hide();
答案 0 :(得分:2)
您只阅读一个int
。相反,您应该循环播放直到达到EOF:
while (true) {
try {
System.out.println(is.readInt());
} catch (EOFException e) {
// Reached the end of the file, break out the loop
break;
}
}
答案 1 :(得分:0)
只需将您在write方法中使用的for循环与 System.out.println(is.readInt());