何羡玉 发表于 2013-5-13 13:20
package enhanceTest;
public abstract class enumTest { - package enhanceTest;
-
- public abstract class enumTest {
- private enumTest(){}
- public static final enumTest Sun= new enumTest()
- { public String toLocaleString()
- {
- return "星期日";
- }
- };
-
- public abstract String toLocaleString();
-
- /**
- * @param args
- */
- public static void main(String[] args) {
- enumTest a=enumTest.Sun;
- String b=a.toLocaleString();
- System.out.println(b);
- }
-
- }
复制代码 挺感谢你,你要是吧枚举类型和main方法分开更好些 |