gpt4 book ai didi

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

转载 作者:搜寻专家 更新时间:2023-11-01 01:01:21 25 4
gpt4 key购买 nike

我是 Java 新手。想知道是否所有 Java SE 类都可以在 Java ME 中使用。如果不是,为什么会这样?

最佳答案

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

http://i.stack.imgur.com/doIiv.gif

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. All java.lang.* classes which normally implement Serializable 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com