What does strikethrough mean in Netbeans?

2019-06-15 09:59发布

What does it mean when things are written in strikethrough in Netbeans, like getObject in the example below?

enter image description here

Version: Netbeans 6.8

1条回答
甜甜的少女心
2楼-- · 2019-06-15 10:36

The method has been deprecated (i.e. replaced by a newer method, which you should probably use instead).

In other words, for some backward compatibility, the method you're calling is still in the API, but has been replaced by newer code/methods. Often this happens when an API is redesigned or updated, especially when a given API update changes its fundamental approach to a problem. When that happens, the old way of doing something will be deprecated, and you are therefore encouraged (though not required, so long as your code compiles and runs) to use the new stuff.

查看更多
登录 后发表回答