20/11/2008
Section 2: CLDC 1.0 and 1.1
考试大纲要求:
- Identify correct and incorrect statements or examples about the requirements and scope of the CLDC specification, including the differences between 1.0 and 1.1.
Describe the ways in which a CLDC virtual machine does and does not adhere to the Java Language Specification (JLS) and the Java Virtual Machine specification.
Identify correct and incorrect statements or examples about CLDC classes including those derived from J2SE, and the CLDC-specific classes, including identifying which core J2SE classes are NOT included in CLDC, or have different behaviors (for example java.lang.String and io classes)
Given the differences and limitations of exception/error handling with CLDC devices, handle exceptions correctly.
Write code that effectively manages memory and garbage collection.
一条一条学习:
2.1 Identify correct and incorrect statements or examples about the requirements and scope of the CLDC specification, including the differences between 1.0 and 1.1. |
2.1.1 CLDC 1.1和CLDC 1.0的区别:
Floating point support has been added.增加了对浮点数的支持,增加了Float和Double类
- All floating point byte codes are supported by CLDC 1.1.
- Classes Float and Double have been added.
- Various methods have been added to the other library classes to handle floating point values.
- Weak reference support (small subset of the J2SE weak reference classes) has been added. 对于弱引用的支持
- Classes Calendar, Date and TimeZone have been redesigned to be more J2SE compliant. 注意这里是重新设计,不是新增的内容
- Error handling requirements have been clarified, and one new error class, NoClassDefFoundError, has been added. 澄清了对于Error处理的要求,增加了一个新的NoClassDefFoundError
- In CLDC 1.1, Thread objects have names like threads in J2SE do. The method Thread.getName() has been introduced, and the Thread class has a few new constructors that have been inherited from J2SE. 增加了一个Thread.getName()方法
Various minor library changes and bug fixes have been included, such as the addition of the following fields and methods:
- Boolean.TRUE and Boolean.FALSE
- Date.toString()
- Random.nextInt(int n)
- String.intern()
- String.equalsIgnoreCase()
- Thread.interrupt()
- Minimum memory budget has been raised from 160 to 192 kilobytes, mainly because of the added floating point functionality. 最小内存要求由于浮点数功能从160k增加到192k
- Specification text has been tightened and obsolete subsections removed.
Much more detailed verifier specification ("CLDC Byte Code Typechecker
Specification") is provided as an appendix.
2.1.2 CLDC 1.0和1.1的要求Requirement和范围Scope: