提交 e30d1154 编写于 作者: E Ehsan

removes the Citizen class in src directory.

changes messages printed by the secretary and the president.
上级 5d790266
package com.designpatterns.structural.proxy;
import com.designpatterns.structural.proxy.president.PresidentSecretary;
public class Citizen {
public static void main(String[] args) {
PresidentSecretary presidentSecretary = new PresidentSecretary();
presidentSecretary.leaveValidMessageForPresident("Hello president.");
}
}
......@@ -22,6 +22,6 @@ public class President {
void talkToThePresident(String message){
System.out.println("I, the President, have received this message:" + message);
System.out.println("President: I have received the message:" + message);
}
}
......@@ -13,9 +13,9 @@ public class PresidentSecretary {
if(!isMessageValid(message))
throw new RuntimeException("invalid message");
System.out.println("message is being sent to the President...");
System.out.println("Secretary: message is being sent to the President...");
president.talkToThePresident(message);
System.out.println("message is received by the President.");
System.out.println("Secretary: message is sent to the President.");
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册