/*
* ReadFileTest.java
*
* Created on 2003年11月18日, 下午2:52
*/
/**
*
* @author hua
*/
public class ReadFileTest {
ReadFile readFile=new ReadFile();
/** Creates a new instance of ReadFileTest */
public ReadFileTest() {
readFile.GetValue(); //read a line in the file
/* ReadFile is the class defined to read the file. GetValue is the method to get the useful values of the current line.*/
System.out.println("1.arrival time: "+readFile.cust.arrivalTime);
System.out.println("1.length: "+readFile.cust.length);
readFile.GetValue(); // read another line
System.out.println("1.arrival time: "+readFile.cust.arrivalTime);
System.out.println("1.length: "+readFile.cust.length);
}
public static void main(String[] args) {new ReadFileTest();
}
}
运行后,打印出来的数值是一样的。没有读下一行。什么问题呢?
* ReadFileTest.java
*
* Created on 2003年11月18日, 下午2:52
*/
/**
*
* @author hua
*/
public class ReadFileTest {
ReadFile readFile=new ReadFile();
/** Creates a new instance of ReadFileTest */
public ReadFileTest() {
readFile.GetValue(); //read a line in the file
/* ReadFile is the class defined to read the file. GetValue is the method to get the useful values of the current line.*/
System.out.println("1.arrival time: "+readFile.cust.arrivalTime);
System.out.println("1.length: "+readFile.cust.length);
readFile.GetValue(); // read another line
System.out.println("1.arrival time: "+readFile.cust.arrivalTime);
System.out.println("1.length: "+readFile.cust.length);
}
public static void main(String[] args) {new ReadFileTest();
}
}
运行后,打印出来的数值是一样的。没有读下一行。什么问题呢?