- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
我是 Java 新手。想知道是否所有 Java SE
类都可以在 Java ME
中使用。如果不是,为什么会这样?
最佳答案
不,只有一个子集可用,请参阅 http://java.sun.com/javame/technology/index.jsp进行介绍。
this Wikipedia article 中给出了简要概述:
Noteworthy limitations
Compared to the Java SE environment, several APIs are absent entirely, and some APIs are altered such that code requires explicit changes to support CLDC. In particular, certain changes aren't just the absence of classes or interfaces, but actually change the signatures of existing classes in the base class library. An example of this is the absence of the
Serializable
interface, which does not appear in the base class library due to restrictions on reflection usage. Alljava.lang.*
classes which normally implementSerializable
do not, therefore, implement this tagging interface.Other examples of limitations depend on the version being used, as some features were re-introduced with version 1.1 of CLDC.
CLDC 1.0 and 1.1
- The Serializable interface is not supported.
- Parts of the reflection capabilities of the Java standard edition:
- The
java.lang.reflect
package and any of its classes not supported.- Methods on
java.lang.Class
which obtain Constructors or Methods or Fields.- No finalization. CLDC does not include the Object.finalize() method.
- Limited error handling. Non-runtime errors are handled by terminating the application or resetting the device.
- No Java Native Interface (JNI)
- No user-defined class loaders
- No thread groups or daemon threads.
关于java-me - Java ME 中是否提供所有 Java SE 类?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1985360/
我是一名优秀的程序员,十分优秀!