When writing to a text file in java , how do I enter values into a new line
code snippet
while (rs.next()) {
int sport = rs.getInt("sport");
String name = rs.getString("name");
out.write(sport + " : " + name);}
the text file populates " value1 value2 value3...etc" I want it to populate
value1
value2
value3
.
Very simple
out.write(sport + " : " + name + "\n");
That's all.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With