import java.io.BufferedReader;
//
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
System.out.println(reader.readLine());
public class FileIO {
public static void main(String[] args) {
String[] names = {"John", "Carl", "Jerry"};
try {
BufferedWriter writer = new BufferedWriter(new FileWriter("output.txt"));
writer.write("Writing to a file.");
writer.write("
Here is another line.");
for (String name : names) {
writer.write("
" + name);
}
writer.close();
} catch (IOException e) {
e.printStackTrace();
}
try {
BufferedReader reader = new BufferedReader(new FileReader("output.txt"));
String line;
while((line = reader.readLine()) != null) {
System.out.println(line);
}
reader.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
// best answer is to look at documentation from Oracle
https://docs.oracle.com/javase/8/docs/api/java/io/BufferedReader.html
import.java.io.BufferedReader;
public static String IN() {
java.io.BufferedReader d = new java.io.BufferedReader(new java.io.InputStreamReader(System.in));
String str = "";
try {
str = d.readLine();
} catch (Exception e) {
e.printStackTrace();
}
return str;
}