1700469786
1700469787
//把信放到信封里
1700469788
1700469789
public void letterInotoEnvelope();
1700469790
1700469791
//然后邮递
1700469792
1700469793
public void sendLetter();
1700469794
1700469795
}
1700469796
1700469797
在接口中定义了完成的一个写信过程,这个过程需要实现,其实现类如代码清单23-2所示。
1700469798
1700469799
代码清单23-2 写信过程的实现
1700469800
1700469801
public class LetterProcessImpl implements ILetterProcess{
1700469802
1700469803
//写信
1700469804
1700469805
public void writeContext(String context){
1700469806
1700469807
System.out.println(“填写信的内容……”+context);
1700469808
1700469809
}
1700469810
1700469811
//在信封上填写必要的信息
1700469812
1700469813
public void fillEnvelope(String address){
1700469814
1700469815
System.out.println(“填写收件人地址及姓名……”+address);
1700469816
1700469817
}
1700469818
1700469819
//把信放到信封中,并封好
1700469820
1700469821
public void letterInotoEnvelope(){
1700469822
1700469823
System.out.println(“把信放到信封中……”);
1700469824
1700469825
}
1700469826
1700469827
//塞到邮箱中,邮递
1700469828
1700469829
public void sendLetter(){
1700469830
1700469831
System.out.println(“邮递信件……”);
1700469832
1700469833
}
1700469834
1700469835
}
[
上一页 ]
[ :1.700469786e+09 ]
[
下一页 ]