The moose likes Beginning Java and the fly likes enter to new line Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "enter to new line" Watch "enter to new line" New topic

enter to new line

ravi krishna muthireddy

Joined: Apr 02, 2007
Posts: 9
hello sir
iam retriving fields from table and adding it to
vector while writing it to file every field should entered
into new line, as i am using FileWriter for writing

String empno=rs.getInt(1);
Vector v=new Vector();
FileWriter f=new FileWriter(filename);
value retrived from vector say x

sir here it is appending everything into single line
but i want everthing in new line
like this
Suleman zia
Ranch Hand

Joined: Apr 19, 2007
Posts: 70
You can use Stringbuffer. check the api docs.

SCJP 1.5
rohit leeta
Ranch Hand

Joined: May 02, 2007
Posts: 49
As far as i understand your problem, you should read this class/method:

<a href="" target="_blank" rel="nofollow">Java Forums</a>
Sidd Kulk
Ranch Hand

Joined: Feb 20, 2007
Posts: 152
Also your code would be much more readable if you could use code tags.

And for your doubt, you can use escape characters like \n or \t to provide spaces or new line breaks. StringBuffer could be used as well.

I agree. Here's the link:
subject: enter to new line
jQuery in Action, 3rd edition