package main;// Press Shift twice to open the Search Everywhere dialog and type `show whitespaces`, // then press Enter. You can now see whitespace characters in your code. public class SimpleFactoryTest { public static void main(String[] args) { try { SimpleFactory.createProduct("A").show(); } catch (NullPointerException e) { System.out.println("没有A这款产品,无法生产~"); } try { SimpleFactory.createProduct("B").show(); } catch (NullPointerException e) { System.out.println("没有B这款产品,无法生产~"); } try { SimpleFactory.createProduct("C").show(); } catch (NullPointerException e) { System.out.println("没有C这款产品,无法生产~"); } try { SimpleFactory.createProduct("D").show(); } catch (NullPointerException e) { System.out.println("没有D这款产品,无法生产~"); } } }