日期:2014-05-20 浏览次数:21003 次
public class MyFile implements Runnable{
public void run()
{
while (true)
{
try{
FileReader fr=new FileReader(new File("a.txt")) ;
String line=fr.readLine(); System.out.println(line);
}catch(IOException err) {
}
Sleep(1000);//这里为什么要用Thread.sleep。这个thread是哪里来的?是从Object继承来的吗?
}
}