java: how to write a text file

0 votes
asked Jan 3 by (130 points)
retagged Jan 3 by
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 by (140 points)
you can do like this

// and your texst

or

/* and type a multi line */
0 votes
answered Apr 9 by (240 points)
edited Apr 9 by
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.
...