It is a bad practice to use Sun's proprietary Java classes?

前端 未结 7 1840
孤独总比滥情好
孤独总比滥情好 2020-11-22 08:59

The compiler display warnings if you use Sun\'s proprietary Java classes. I\'m of the opinion that it\'s generally a bad idea to use these classes. I read this somewhere. Ho

7条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-22 09:13

    Because they are internal APIs: they are subject to change in a undocumented or unsupported way and they are bound to a specific JRE/JDK (Sun in your case), limiting portability of your programs.

    Try to avoid uses of such APIs, always prefer a public documented and specified class.

提交回复
热议问题