Using text files to get values
Hi,
I cant remember how to get specific values from an existing text file.
I think I need to use an array but am unsure how to populate it and retrieve the correct positions. I want to use the values to update variables for use in algorithms.
I am trying to manipulate some existing code from a previous project but this has only set data to use.
public class BankModelED {
private BankED accArray[] = {new BankED (1001, "abcd", 10000.00),
new BankED (1002, "efgh", 25020.00),
new BankED (1003, "mnop", 2300.99),
new BankED (1004, "Vwxy", 23456.99)
};
public BankED getAccountED(long lngAccNo) {
for (int i = 0; i < accArray.length; i++) {
if (accArray[i].getAccountNoED() == lngAccNo) {
return accArray[i];
}
}
return null;
}
}
If someone could provide an example on how to read and return values would be much appreciated.
Thanks.