Skip to content

Instantly share code, notes, and snippets.

@FreeFly19
Created November 21, 2016 21:09
Show Gist options
  • Select an option

  • Save FreeFly19/b45f671296a16aec3e670a3f445b879f to your computer and use it in GitHub Desktop.

Select an option

Save FreeFly19/b45f671296a16aec3e670a3f445b879f to your computer and use it in GitHub Desktop.
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
public class Task1 {
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();
System.out.println(getAllTextFromFile(file));
file.delete();
}
// Your implementation of getAllTextFromFile function
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment