Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
15
Task/Write-entire-file/Java/write-entire-file-2.java
Normal file
15
Task/Write-entire-file/Java/write-entire-file-2.java
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.StandardOpenOption;
|
||||
|
||||
public final class WriteEntireFile {
|
||||
|
||||
public static void main(String[] aArgs) throws IOException {
|
||||
String contents = "Hello World";
|
||||
String filePath = "output.txt";
|
||||
|
||||
Files.write(Path.of(filePath), contents.getBytes(), StandardOpenOption.CREATE);
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue