@@ -0,0 +1,1701 @@
+// --------------------- two man interface%0A%0Apublic interface Male %7B%0A    void talk();%0A%7D%0A%0Apublic interface Female %7B%0A    void talk();%0A%7D%0A%0A// --------------------- black man%0A%0Apublic class BlackMale implements Male %7B%0A    public void talk() %7B%0A        System.out.println(%22BlackMale talking...%22);%0A    %7D%0A%7D%0A%0Apublic class BlackFemale implements Female %7B%0A    public void talk() %7B%0A        System.out.println(%22BlackFemale talking...%22);%0A    %7D%0A%7D%0A%0A// --------------------- white man%0A%0Apublic class WhiteMale implements Male %7B%0A    public void talk() %7B%0A        System.out.println(%22WhiteMale talking...%22);%0A    %7D%0A%7D%0A%0Apublic class WhiteFemale implements Female %7B%0A    public void talk() %7B%0A        System.out.println(%22WhiteFemale talking...%22);%0A    %7D%0A%7D%0A%0A// --------------------- man factory%0A%0Apublic interface Factory %7B%0A    Male createMale();%0A    Female createFemale();%0A%7D%0A%0Apublic class BlackFactory implements Factory%7B%0A    public Male createMale() %7B%0A        return new BlackMale();%0A    %7D%0A%0A    public Female createFemale() %7B%0A        return new BlackFemale();%0A    %7D%0A%7D%0A%0Apublic class WhiteFactory implements Factory %7B%0A    public Male createMale() %7B%0A        return new WhiteMale();%0A    %7D%0A%0A    public Female createFemale() %7B%0A        return new WhiteFemale();%0A    %7D%0A%7D%0A%0A// --------------------- test code%0A%0Apublic static void main(String%5B%5D args) throws InterruptedException %7B%0A%09Factory blackFactory = new BlackFactory();%0A%09Factory whiteFactory = new WhiteFactory();%0A%0A%09Male blackMale = blackFactory.createMale();%0A%09Male whiteMale = whiteFactory.createMale();%0A%09Female blackFemale = blackFactory.createFemale();%0A%09Female whiteFemale = whiteFactory.createFemale();%0A%0A%09blackMale.talk();%0A%09whiteMale.talk();%0A%09blackFemale.talk();%0A%09whiteFemale.talk();%0A%7D

add absturct factory