Created
November 21, 2016 21:12
-
-
Save FreeFly19/137a71933d2587254d0350d82f1f1223 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.io.File; | |
| import java.io.FileOutputStream; | |
| import java.io.IOException; | |
| public class Task2 { | |
| public static void main(String[] args) throws IOException { | |
| File file = new File("D:/test-java.txt"); | |
| file.createNewFile(); | |
| FileOutputStream outputStream = new FileOutputStream(file); | |
| outputStream.write("Hello, dear student!\nHow are you?".getBytes()); | |
| outputStream.close(); | |
| TextFileReader textFileReader = new TextFileReader(file); | |
| System.out.println(textFileReader.getContentAsString()); | |
| file.delete(); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment