package factory.static1; import factory.BMW; /** * Copyright (c) 2021, ustchcs and its affiliates. All rights reserved. More info see www.ustchcs.com * * @author cch * @package Thymeleaf1 com.example.demo.design * @node */ public class StaticFactory { public static void main(String[] args) { BMW car730 = BMWFactory.productBMW("730"); BMW car840 = BMWFactory.productBMW("840"); if (car730 != null) { car730.run(); } if (car840 != null) { car840.run(); } } }