ITPub博客

首页 > Linux操作系统 > Linux操作系统 > NetBeans 提示 import from forbidden package的原因

NetBeans 提示 import from forbidden package的原因

原创 Linux操作系统 作者:davidyu720 时间:2019-05-08 16:12:06 0 删除 编辑

原因:不建议import sun.* 的包。这些包不是官方正式的,在不同的平台上也许会不同;在不同的JAVA版本下,很可能会不通知就发生变化。

The sun.* packages are not part of the supported, public interface.
A Java program that directly calls into sun.* packages is not guaranteed to work on all Java-compatible platforms. In fact, such a program is not guaranteed to work even in future versions on the same platform.
For these reasons, there is no documentation available for the sun.* classes.

ref: http://java.sun.com/products/jdk/faq/faq-sun-packages.html
Why Developers Should Not Write Programs That Call 'sun' Packages


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/9844649/viewspace-580174/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2007-08-18

  • 博文量
    235
  • 访问量
    181051