MCPcopy Create free account
hub / github.com/Seogeurim/CS-study / FactoryTest

Class FactoryTest

contents/design-pattern/code/FactoryJava/FactoryTest.java:1–10  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1public class FactoryTest {
2
3 public static void main(String[] args) {
4 Product pencil = ProductFactory.getProduct("Pencil");
5 pencil.sell(); // sell Pencil !!!
6
7 Product note = ProductFactory.getProduct("Note");
8 note.sell(); // sell Note !!!
9 }
10}
11
12interface Product {
13 public void sell();

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected