i am totally new to this forum and i am not sure if i am putting this quesiton in right segment. if i am not sorry for that . i can't seems to figure out how to save file. i have two file namely lower.txt and upper.txt. i can't figure how to give condition or say like if the user input is less than number 60 then save that file in lower.txt else in upper.txt. can anyone please suggest what kinda code to use and where in try n catch statement should put in ?
If so, then all you need to do is apply the desired file name when you create the File instance.
if not, then the tutorial should get you going.
ten chang wrote:thanks for the quick response, i have all the user input in place the only problem was i couldn't redirect if the input has more than 60. i can only save in lower.txt
So you don't know how to write an if statement?
Or you don't know how to test if some value is greater than 60?
ten chang wrote:i tried with
am not sure if this is the right way
And when you looked at the documentation for that write() call, it told you that the Writer will attach itself to the file name you pass, and write out whatever you're thinking of, without you telling it what to write?
Because that how you must think it behaves, based on what you said you're trying to do.