ModenPostOffice.java
上传用户:hensond
上传日期:2021-12-27
资源大小:817k
文件大小:1k
- package com.company.section2;
- import com.company.section1.ILetterProcess;
- import com.company.section1.LetterProcessImpl;
- /**
- * @author cbf4Life cbf4life@126.com
- * I'm glad to share my knowledge with you all.
- */
- public class ModenPostOffice {
- private ILetterProcess letterProcess = new LetterProcessImpl();
-
- //写信,封装,投递,一体化了
- public void sendLetter(String context,String address){
-
- //帮你写信
- letterProcess.writeContext(context);
-
- //写好信封
- letterProcess.fillEnvelope(address);
-
- //把信放到信封中
- letterProcess.letterInotoEnvelope();
-
- //邮递信件
- letterProcess.sendLetter();
-
- }
- }