女友多的好处 (简单工厂模式)
java 的switch 语句的case 匹配为什么不能像delphi一样 支持String类型 哦
这里可以通过反射的话效果更佳
public class BeautifulGirl extends DreamGirl { public void can_do_something_for_boy() { System.out.println("陪老公逛街!!!"); }}public class LivelyGirl extends DreamGirl { public void can_do_something_for_boy() { System.out.println("陪老公聊天!!!"); }}public class LooksMediocreGirl extends DreamGirl { public void can_do_something_for_boy() { System.out.println("给老公做饭!!!"); }} public class SensibleGirl extends DreamGirl { public void can_do_something_for_boy() { System.out.println("给老公洗衣服!!!"); }}