Add creational patterns, Interpreter; remove scripts; update README
This commit is contained in:
11
01-creational/factory-method/EmailNotification.java
Normal file
11
01-creational/factory-method/EmailNotification.java
Normal file
@@ -0,0 +1,11 @@
|
||||
package factorymethod;
|
||||
|
||||
public class EmailNotification implements Notification {
|
||||
private final String email;
|
||||
public EmailNotification(String email) { this.email = email; }
|
||||
|
||||
@Override
|
||||
public void send(String message) {
|
||||
System.out.println("Email -> " + email + ": " + message);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user