且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Java ME中是否提供所有Java SE类?

更新时间:2023-12-04 10:48:04

否,只有一个子集可用,请参见 http://java.sun.com/javame/technology/index.jsp 进行介绍.

No, only a subset is available, see http://java.sun.com/javame/technology/index.jsp for an introduction.

此Wikipedia文章:

值得注意的局限性

Java SE 环境相比,完全没有几个API,有些是进行了更改,以使代码需要进行显式更改才能支持CLDC.特别是,某些更改不仅是缺少类或接口,而且实际上是在基类库中更改现有类的签名.例如,缺少Serializable接口,由于对反射用法的限制,该接口未出现在基类库中.因此,通常实现Serializable的所有java.lang.*类均不实现此标记接口.

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. All java.lang.* classes which normally implement Serializable do not, therefore, implement this tagging interface.

其他限制示例取决于所使用的版本,因为CLDC 1.1版重新引入了某些功能.

Other examples of limitations depend on the version being used, as some features were re-introduced with version 1.1 of CLDC.

  • 不支持Serializable接口.
  • Java标准版的部分反射功能:
    • java.lang.reflect软件包及其任何类均不受支持.
    • java.lang.Class上的方法,用于获取构造方法或方法或字段.
    • 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.