For example - I defined :
FileWriter fstream = new FileWriter("log.txt");
BufferedWriter out = new BufferedWriter(fstream);
in class "A", and in it I have:
public void record(String payed, String guess, String date, boolean won, String result, String sigma) throws IOException{
String message = date +" payed: "+payed +"$ that $ will be: "+guess +" rsult was: "+result +" total winnings: "+ sigma+"$";
out.write(message+"\n");
...
but the actual class that updates "A" (uses record) is "B" (which should. obviously contain "A"'s object).
db.record(f.getBet(), Double.toString((double)f.getSldDlr()/1000), f.getDlu(), won, f.getResultR(), this.editNum(Double.toString(sum)) );
I've tried defining "out" as static, defining it in main, and passing it in "B"'s C'tor, and neither of these helped.
What is wrong here?
Thanks.


Sign In
Create Account


Back to top










