wwhat does this mean
hi wat do each lines mean, am i correct
publicboolean write()//write function
{
try///try catch
{
PrintWriter savefile;//creates saved file
save =new PrintWriter(filename);
save.println(genXML());//calls genXML function
save.close();
returntrue;
}
catch(Exception e){returnfalse;}
}
}
[983 byte] By [
magiciana] at [2007-11-27 0:51:06]

> hi wat do each lines mean, am i correct
> >public boolean write() //write function
> try ///try catch
> {
> PrintWriter savefile; //creates saved file
> save = new PrintWriter(filename);
> save.println(genXML()); //calls genXML function
> save.close();
> return true;
> }
> catch(Exception e){ return false; }
> }
> }
>
>
No, you are not correct. Thanks for playing. Good bye.
Let me guess, save and savefile should have been the same variable, it's an error that two names are used?
I seriously doubt that you're getting anyone here to spell out what's in a piece of code that we don't know where comes from, even if you throw 25 Duke stars at us. Why are you asking?
OleVVa at 2007-7-11 23:21:44 >

i just want to know wwat each of the lines actually do
public boolean write() //write function
> try ///try catch
> {
> PrintWriter save; //creates saved file
> save = new PrintWriter(filename);
> save.println(genXML()); //calls genXML function
> save.close();
> return true;
> }
> catch(Exception e){ return false; }
> }
> }
>
> wat?
I really don't understand how you could've written that snippet of code
without understanding what each line means. (or supposed to mean
in your opinion). Consequently your question doesn't make any sense
if you really don't understand what you have written yourself.
As a corollary if you didn't write that yourself how could you ask
whether or not you're correct without writing down what your
understanding of this all is?
kind regards,
Jos
JosAHa at 2007-7-11 23:21:45 >

I'm not sure about each line, but this description is incorrect anyway:try ///try catchNot "try catch" but "try". You can easily check by yourself - there is only "try" in this line.
In your code you should use a FileWriter with the PrintWrite.... but this is basic know for programming in java... take a good book about java....
>public boolean write() //write function
A function is called a method in Java; otherwise correct.
> try ///try catch
See earlier reply.
> PrintWriter savefile; //creates saved
Incorrect. Declares a local variable.
> save.println(genXML()); //calls genXML function
Correct; additionally passes the result of the call to save.println().
Am I helping at all?
Jos has got a point: tell us what your own understanding is, it'll make the discussion a lot easier.
OleVVa at 2007-7-11 23:21:45 >

I believe my reply was the best of all, so far.I/O regards,Filestream.P.S. :-)
> I believe my reply was the best of all, so far.t'was not! qed! so there! :-Pkind regards,Jos ;-)
JosAHa at 2007-7-11 23:21:45 >

> qed! QED? Post Hoc Ergo Propter Hoc! :)
wwhat what do you want? why do you keep touching me?i am a medieval man!
> why do you keep touching me?wait for it....I don't want anybody elseWhen I think about you I touch myselfOoh I don't want anybody else oh no, oh no, oh no
> > qed! > > QED? Post Hoc Ergo Propter Hoc! :)quidquid latine dictum sit altum viditur
Hoi, is het vanavond druk?
> wwhat what do you want? why do you keep touching me?That's a rather personal question sir.kind regards,Jos ;-)
JosAHa at 2007-7-21 19:53:59 >
