V
V
Volodar Znatsky2016-06-15 11:49:20
Java
Volodar Znatsky, 2016-06-15 11:49:20

Is it possible to write data to a file from a new line?

By default, Java will write information to the file on one line. In theory, if you enter \n into a variable, then the subsequent test will be written from a new line. But this rule had no effect on writing to the file, and as a result String test = "First line \n Second line" will be written to the file "First line Second line". What would you recommend for a line break?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
#
#algooptimize #bottize, 2016-06-15
@ja8mraz

I advise you to find a mistake, since everything works fine, you can write rn and not n if your editor does not see the line feed.

A
abs0lut, 2016-06-15
@abs0lut

Default

What does "default" mean? Bring some code
I advise you to read the documentation on the java.io package - in particular the PrintWriter class

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question