mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-21 04:24:12 +00:00
added abstract-factory sample
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
package com.iluwatar;
|
||||
|
||||
public class ElfKingdomFactory implements KingdomFactory {
|
||||
|
||||
public Castle createCastle() {
|
||||
return new ElfCastle();
|
||||
}
|
||||
|
||||
public King createKing() {
|
||||
return new ElfKing();
|
||||
}
|
||||
|
||||
public Army createArmy() {
|
||||
return new ElfArmy();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user