(1)能不能有个例子告诉我接口如何实现多重继承的!
(2)在流里,我在一个文本a.txt里,是一首歌的歌词,我现在希望能够一个字一个字符在屏幕上输出,我想说明的是一个字,一个字的输出,要有层次感!谢谢了,我试着用Therad.sleep(),但是我没做出来,希望各位帮帮忙,解决我这个小疑问!
(2)在流里,我在一个文本a.txt里,是一首歌的歌词,我现在希望能够一个字一个字符在屏幕上输出,我想说明的是一个字,一个字的输出,要有层次感!谢谢了,我试着用Therad.sleep(),但是我没做出来,希望各位帮帮忙,解决我这个小疑问!
interface Interface1{}
interface Interface2{}
2、/*
* Created on 2005-9-1
*
* TODO To change the template for this generated file go to
* Window - Preferences - Java - Code Style - Code Templates
*/
package io;import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;/**
* @author slash
*
* TODO To change the template for this generated type comment go to Window -
* Preferences - Java - Code Style - Code Templates
*/
public class SayWords {
public static void main(String[] args) {
BufferedReader in = null;
char c = ' ';
try {
in = new BufferedReader(new InputStreamReader(new FileInputStream(
"a.txt")));
} catch (FileNotFoundException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
int t;
try {
while ((t = in.read()) != -1) {
try {
Thread.sleep(1000);
} catch (InterruptedException e2) {
// TODO Auto-generated catch block
e2.printStackTrace();
}
System.out.print((char) t);
} } catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}}