Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

java: how to write a text file

0 votes
asked Jan 3, 2019 by Ubaldo Rauso (130 points)
retagged Jan 3, 2019 by Ubaldo Rauso
Hi

I'm trying to write a text file with a Java program.

I'm able to read a file with your tool but not to read. Can you help me?

Thanks in advance

ubaldo

2 Answers

0 votes
answered Jan 4, 2019 by aylonbrandes (140 points)
you can do like this

// and your texst

or

/* and type a multi line */
0 votes
answered Apr 9, 2019 by zemiak (490 points)
edited Apr 9, 2019 by zemiak
java prg solution
https://www.baeldung.com/java-write-to-file

if you mean how to write and use file on online GDB webpage,
In GDB web: open new file on other tab (ctrl+M) and use it's name as file name in your code
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...