动手动脑
仔细阅读示例: EnumTest.java,运行它,分析运行结果?
你能得到什么结论?你掌握了枚举类型的基本用法了吗?
package dongshoudongnao;
import java.util.*;
import java.util.*;
public class meiju {
private enum MyEnum{
ONE, TWO, THREE
}
public static void main(String[] args) {
for(MyEnum value:MyEnum.values()){
System.out.println(value);
}
}
}
你看到了什么样的输出,意外吗?
package dongshoudongnao;
import java.util.*;
import java.util.*;
public class meiju {
public static void main(String[] args) {
System.out.println("0.05+0.01="+(0.05+0.01));
System.out.println("1.0-0.42="+(1.0-0.42));
System.out.println("4.015*100=*"+(4.015*100));
System.out.println("123.3/100="+(123.3/100));
}
}
System.out.println("0.05+0.01="+(0.05+0.01));
System.out.println("1.0-0.42="+(1.0-0.42));
System.out.println("4.015*100=*"+(4.015*100));
System.out.println("123.3/100="+(123.3/100));
}
}