mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-16 00:59:02 +00:00
Work on the DI example. Added second Wizard with injected Tobacco.
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
package com.iluwatar;
|
||||
|
||||
public interface Tobacco {
|
||||
public abstract class Tobacco {
|
||||
|
||||
public void smoke();
|
||||
|
||||
public void smoke(Wizard wizard) {
|
||||
System.out.println(String.format("%s smoking %s", wizard.getClass().getSimpleName(), this.getClass().getSimpleName()));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user