Created
June 8, 2020 21:46
-
-
Save asolntsev/73dfde2f869805493734d2d962bbca07 to your computer and use it in GitHub Desktop.
This file contains 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.FileWriter; | |
import java.io.IOException; | |
import java.io.PrintWriter; | |
public class FileTest { | |
public static void main(String[] args) throws IOException { | |
int[] numbers = new int[] {1,2,3,4,5}; | |
try (PrintWriter writer = new PrintWriter(new FileWriter("zopa.txt"))) { | |
for (int number : numbers) { | |
writer.println(number); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment