Home »
Code Examples »
Scala Code Examples
Scala - How to write string to a file in one statement? Code Example
The code for How to write string to a file in one statement?
// Import statement
import java.io.PrintWriter
// Statement to write string to a file
// in one statement
new PrintWriter("file1.txt") { write("Content of the file"); close }
Code by IncludeHelp,
on August 8, 2022 02:50