public static void main(String[] args) { ComponentFactory factory = WindowsComponentFactory.getInstance(); CustomButton button1 = factory.createButton(); CustomLabel label1 = factory.createLabel(); System.out.println("Button1: " + button1.getText()); System.out.println("Label1: " + label1.getText()); /* * Output: * Button1: WindowsButton - Click me * Label1: WindowsLabel - Read me */ factory = LinuxComponentFactory.getInstance(); CustomButton button2 = factory.createButton(); CustomLabel label2 = factory.createLabel(); System.out.println("Button2: " + button2.getText()); System.out.println("Label2: " + label2.getText()); /* * Output: * Button2: LinuxButton - Click me * Label2: LinuxLabel - Read me */ }