my string doesnot contain any newline characters, I am using note pad to edit the created file(which is .txt file).
i am using the follwing code--
BufferedWriter out=new BufferedWriter(new FileWriter(somefile.txt)
String st="some lengthy string";
out.write(st);
Even though my string doesnt contain any new line characters, in the note pad the lengthy string is appearing in multiple lines.
That is because Notepad displays it that way, not because the file contains multiple lines.
Open Notepad, click the menu Format and make sure that Word Wrap is off.
If the line is really long, Notepad may display it in multiple lines regardless of the word wrap setting. There's nothing you can do about that, that's just how Notepad works. Use a better text editor than Notepad.