菜鸟一问,如何使用下面的类
interface TextUpdatable{
void doTextUpdate(String s);
}
class TextSource{
TextUpdatable receiver;
public TextSource(TextUpdatable r){
receiver = r;
}
public void sendText(String s){
receiver.doTextUpdate(s);
}
}
class TickerTape implements TextUpdatable{
public void doTextUpdate(String s){
System.out.println(s);
}
}
如何使用上面的类,谢谢