package com.cug.datastream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class SystemInDemo {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String line = null;
System.out.println("Please enter a String:");
line = br.readLine();
System.out.println(line);
System.out.println("Please enter a int:");
line = br.readLine();
int value = Integer.parseInt(line);
System.out.println(value);
}
}
package com.cug.datastream;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.PrintStream;
public class SystemOutDemo {
public static void main(String[] args) throws IOException {
// PrintStream ps = System.out;
// ps.println("safdas");
// ps.close();
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
bw.write("dfsafd");
bw.newLine();
bw.write("I Love you!!!");
bw.flush();
bw.close();
}
}