JAVA
java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
//DOESNT WORK IN THE APP.
//Or it does. Good luck playing around with the directory path.
import java.io.*;
import java.util.Scanner;
public class fw {
public static final String FILENAME = "C:\\test\\output.txt";
public static void main(String[] args) {
System.out.print("Ok just type something and take a look at C:\\test\\output.txt");
Scanner sc = new Scanner(System.in);
String data ="\n"+sc.nextLine()+"\n";
BufferedWriter bw = null;
FileWriter fw = null;
try {
File file = new File(FILENAME);
if (!file.exists()) {
file.createNewFile();
}
fw = new FileWriter(file.getAbsoluteFile(), true);
bw = new BufferedWriter(fw);
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run