本帖最后由 真真姐 于 2012-10-21 14:29 编辑
- public abstract class WeekDay{
- private WeekDay(){
- }
- public abstract WeekDay nextDay();
- public final static WeekDay SUN = new WeekDay(){ //这讲到了大括号就是子类,有点忘记了,该去怎么理解,请分解代码
- public WeekgDay nextDay(){
- return MON;
- }
- public final static WeekDay MON= new WeekDay(){ //这讲到了大括号就是子类,有点忘记了,该去怎么理解,请分解代码
- public WeekgDay nextDay(){
- return SUN;
- }
复制代码 |