?? zy4.java
字號(hào):
import java.io.*;
class thread1 extends Thread {
public void run(){
try{
FileWriter fw=new FileWriter("E:\\包成星\\ZY4\\zy4.txt");
BufferedWriter bw=new BufferedWriter(fw);
bw.write(in.in());
bw.close();
notify();
}catch(Exception e){}
}
}
class thread2 extends Thread {
public void run(){
try{
wait();
FileReader fr=new FileReader("E:\\ZY4\\zy4.txt");
BufferedReader br=new BufferedReader(fr);
System.out.println(br.read());
}catch(Exception e){}
}
}
class in{
static String in(){
String data=null;
try{
System.out.println("請(qǐng)輸入要顯示及保存的文檔:");
InputStreamReader isr=new InputStreamReader(System.in);
BufferedReader br=new BufferedReader(isr);
data=br.readLine();
System.out.println(data);
br.close();
}catch(Exception e){}
return data;
}
}
public class ZY4{
public static void main(String[] args){
thread1 t1=new thread1();
thread2 t2=new thread2();
t1.start();
t2.start();
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -