我是Java編程的新手,我只是有一個簡單的問題,但我做不到,因爲我不知道如何在Java上編寫它。提前致謝。以另一種方法調用Java變量
我想用另一種方法調用變量值。
public static void ReadIN() throws Exception{
BufferedReader br = new BufferedReader(new FileReader("test.txt"));
String line = null;
while ((line = br.readLine()) != null) {
String[] values = line.split(","); // want to be call
for (String inputIN : values) {
inputIN = values[2];
}
}
br.close();
}
public static void checkStatus() {
// call variable 'values' here
}
已經試過這個,沒有工作 – tuturyokgaming 2015-04-02 02:52:17
那麼你到底想要什麼? – tony200910041 2015-04-02 02:53:10
我得到的錯誤,需要:字符串[] 找到:沒有參數 原因:實際和正式參數列表長度不同 – tuturyokgaming 2015-04-02 02:54:21