为什么 getAppProperty() 不是静态方法?

发布于 2024-09-08 23:27:56 字数 106 浏览 4 评论 0原文

getAppProperty(String key) 是 MIDlet 类中的实例方法。既然midlet套件中的所有midlet共享相同的manifest/jad文件,那么为什么它不能是静态方法呢?

getAppProperty(String key) is instance method in MIDlet class. Since all midlet in midlet suite share same manifest/jad file, so why cant it be a static method?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

提赋 2024-09-15 23:27:56

如果电话在同一 JVM 进程内运行多个 MIDlet 套件,则它们都共享相同的 MIDlet 类对象。

如果您随后将该方法设置为静态,它将不知道要从哪个 JAD 文件检索信息。

CLDC 和 MIDP 规范都不阻止手机制造商在同一 JVM 进程中运行多个 MIDlet 套件。事实上,在资源有限的环境中这样做效率更高。

If the phone runs several MIDlet suites inside the same JVM process, they all share the same MIDlet Class object.

If you then make the method static, it won't know which JAD file to retrieve information from.

Neither the CLDC nor the MIDP specifications prevent phone manufacturers from running several MIDlet suites inside the same JVM process. It is in fact more efficient to do so in a resource-constrained environment.

情何以堪。 2024-09-15 23:27:56

这是您询问的关于 J2me 的最紧迫的问题? J2me 又旧又脏,大多数 API 接口都很糟糕。

J2me static 与 getAppProperty 实例的错误程度太低了,我什至认为这个问题不值得回答。

此外,我什至不认为这个问题是可以回答的。

This is the most pressing issue you are asking about J2me? J2me is old dirty and most of API's interfaces suck.

On a scale of things that are wrong with J2me static vs instance of getAppProperty are sooo low I don't even think this question deserves an answer.

Further more I don't even think this question is answerable full stop.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文