} catch (Exception e)
{ String msg=e.toString ();
} // TODO add your handling code here:
}
]
For some reason this program isn't working
Sponsor Sponsor
TheGuardian001
Posted: Sun Jun 06, 2010 7:01 pm Post subject: Re: Urgent: Output and loop
Can you be more specific? What exactly do you mean when you say "For some reason it doesn't work"?
Does the program give an error message? Is it not outputting anything at all, or is it just outputting wrong?
It would probably help to see what the problem is if you gave a full program, instead of a chunk of code that can't be run on its own.
Unnamed.t
Posted: Sun Jun 06, 2010 7:44 pm Post subject: Re: Urgent: Output and loop
TheGuardian001 wrote:
Can you be more specific? What exactly do you mean when you say "For some reason it doesn't work"?
Yup, I agree. For all we know your program could just have some stupid mistake like the method not throwing an IOException or forgeting to import a class or... (u know wut I mean)
It could help a lot if you can copy and paste your code from top to bottom of the whole file.
Zren
Posted: Sun Jun 06, 2010 8:35 pm Post subject: RE:Urgent: Output and loop
You have to close IO streams before it actually writes anything to file in java.
DemonWasp
Posted: Mon Jun 07, 2010 12:21 am Post subject: RE:Urgent: Output and loop
Alternately, you can call .flush() on them to force them to write - this is actually done as part of the close() operation.