为什么sun.misc disencouraged使用? [英] why is sun.misc disencouraged for use?

查看:274
本文介绍了为什么sun.misc disencouraged使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用BASE64En codeR()和BASE64De codeR()在sun.misc,
使用Eclipse和第一IM不得不转向警告,因为访问默认情况下,仅限于它。

I've been using the BASE64Encoder() and BASE64Decoder() in sun.misc, first im using eclipse and had to turn to warnings since the access is restricted to it by default.

中的类作品完美,但我的这个工作中我读过很多,一个人不应该在所有使用sun.misc但由于平时没有人规定一个合适的理由。地方

The classes works perfectly, but during my work with this i've read plenty of places that one should not use sun.misc at all but as usually no one states a proper reason.

所以,我应该远离sun.misc走,为什么?

So, Should I stay away from sun.misc and why?

推荐答案

有没有承诺将继续为这些类的支持;他们可以从JDK中删除,而不在任何版本的警告。

There is no promise to continue support for these classes; they may be removed from the JDK without warning at any release.

此外,并非所有的JDK有这些类,所以你的code可能不会在所有平台上,这违背了Java的意图跑一次编译,到处运行的理念。

Also, not all JDKs have these classes, so your code may not run on all platforms, which goes against the intention of java's "compile once, run anywhere" philosophy.

这篇关于为什么sun.misc disencouraged使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆