Java Factory Pattern

  • + 0 comments

    Only one line of code

    return order.equalsIgnoreCase("Pizza") ? new Pizza() : new Cake();