本帖最后由 张林敏 于 2013-5-3 22:23 编辑
public abstract class Week {
public static final Week Monday = new Week();
public static final Week Tuesday = new Week();
public static final Week Wednesday = new Week();
public static final Week Thursday = new Week();
public static final Week Friday = new Week();
public static final Week Saturday = new Week();
public static final Week Sunday = new Week();
}
像上面的例子,类中有多个自己的对象。然后这些每个对象里面又都包含其他的对象(也包括自己本身对象),这实际上会创建多少个对象。 |