It is a bad practice to use Sun's proprietary

2018-12-31 12:16发布

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. However, aside from the warnings are there any fundamental reasons why you should not use them?

标签: java sun
7条回答
萌妹纸的霸气范
2楼-- · 2018-12-31 12:55

I recently had a case that showed a real-world problem you can hit when you use these classes: we had code that would not compile because a method it was using on a sun.* class simply did not exist in OpenJDK on Ubuntu. So I guess when using these classes you can no longer say things like 'this works with Java 5', because it will only work on a certain Java implementation.

查看更多
登录 后发表回答