|
L7
Oct 27, 2001 18:22:01 GMT -5
Post by Majin_Blues on Oct 27, 2001 18:22:01 GMT -5
does anyone know how to perform an output? not print, but to output to a file?
|
|
|
L7
Oct 28, 2001 21:31:10 GMT -5
Post by CooLiBoP on Oct 28, 2001 21:31:10 GMT -5
Yea its pretty similar to the input...I'll give an example of both: To Read from a file:[/u] in = new BufferedReader(new FileReader("input.txt")); String line = in.ReadLine(); To Output to a file:[/u] private static PrintStream out = new PrintStream(new FileOutputStream("output.txt")); An example of an output would be: out.println("HELLO!");
You can also use other things than println like print if you don't want it on one line...check the API i guess
|
|
|
L7
Oct 28, 2001 21:35:56 GMT -5
Post by Majin_Blues on Oct 28, 2001 21:35:56 GMT -5
thanks...
how'd you know this? you took it up? (gee... my lecture must be behind then)
i figured you would use filewriter instead of outputstream (because of "symmetry" or something in the API book... guess not)
|
|
|
L7
Oct 29, 2001 18:48:39 GMT -5
Post by Brutal_Chicken on Oct 29, 2001 18:48:39 GMT -5
Umm... our prof taught that at the same time as input. Yours did not? Strange...
|
|
|
L7
Oct 29, 2001 20:28:44 GMT -5
Post by Majin_Blues on Oct 29, 2001 20:28:44 GMT -5
it is... it really really is...
the stranger part is, i'm essentially done all that java stuff and i just found out it's due next friday...
>=-X ---> *$@!!!!!!
|
|
|
L7
Nov 2, 2001 19:45:16 GMT -5
Post by Sylph on Nov 2, 2001 19:45:16 GMT -5
wow, u learned all that? we didn't even touch that! i don't even remember my prof teaching us about reading from a file.
|
|
|
L7
Nov 2, 2001 20:40:37 GMT -5
Post by Brutal_Chicken on Nov 2, 2001 20:40:37 GMT -5
Now, reading from a file... that I don't know how to do. Good thing I got this here blue-green booklet to keep me company.
|
|
|
L7
Nov 3, 2001 22:24:52 GMT -5
Post by Sky on Nov 3, 2001 22:24:52 GMT -5
Just to make sure i have the correct output for L7... If my input file have: math137 SUCKS >.< HaHa \\.// ??!!`Hotohori |^i^|
My output file would be: MATH137 sucks >.< hAhA \\.// ??!!`hOTOHORI |^I^| Is that correct??
BTW, for #4 CaptialTwo if i have ABCD as my input...should the output be BCD??
|
|
DK
Junior Member
Posts: 23
|
L7
Nov 3, 2001 23:25:39 GMT -5
Post by DK on Nov 3, 2001 23:25:39 GMT -5
yup Just to make sure i have the correct output for L7... If my input file have: math137 SUCKS >.< HaHa \\.// ??!!`Hotohori |^i^| My output file would be: MATH137 sucks >.< hAhA \\.// ??!!`hOTOHORI |^I^| Is that correct?? BTW, for #4 CaptialTwo if i have ABCD as my input...should the output be BCD??
|
|
DK
Junior Member
Posts: 23
|
L7
Nov 3, 2001 23:31:03 GMT -5
Post by DK on Nov 3, 2001 23:31:03 GMT -5
the A6 handout specifies to not print any blank lines. Does that mean if the input file contains blank lines between ones that aren't blank, we don't print them to the output file?or does this only mean we don't actually do something like System.out.println()? in any of our programs?
|
|
|
L7
Nov 4, 2001 11:32:11 GMT -5
Post by CooLiBoP on Nov 4, 2001 11:32:11 GMT -5
the A6 handout specifies to not print any blank lines. Does that mean if the input file contains blank lines between ones that aren't blank, we don't print them to the output file?or does this only mean we don't actually do something like System.out.println()? in any of our programs? I'm pretty sure they mean don't System.out.println() an entire blank line
|
|
|
L7
Nov 8, 2001 16:40:21 GMT -5
Post by Brutal_Chicken on Nov 8, 2001 16:40:21 GMT -5
Ok, nevermind. I got it.
*sigh*
|
|