Created
August 15, 2020 08:48
-
-
Save LaurentiuGabriel/4bca1ec1acb1b4b01b6e792edb6b9273 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.FileNotFoundException; | |
| import java.io.FileWriter; | |
| import java.io.IOException; | |
| import java.util.Scanner; | |
| public class App { | |
| public static void main(String[] args) throws IOException { | |
| File file = new File("text"); | |
| Scanner scanner = new Scanner(file); | |
| FileWriter fileWriter = new FileWriter(file); | |
| fileWriter.write("Some Text"); | |
| fileWriter.flush(); | |
| fileWriter.close(); | |
| while(scanner.hasNext()){ | |
| System.out.print(scanner.next()); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment