java - 为什么在新日期的代码中使用linethrough

标签 java netbeans-7

我正在使用 netbeans 7.2。 IDE 对类名应用了换行符,这是什么意思以及如何解决它?

Date cookiedate = new Date(timeStamp);

看看照片看起来如何 enter image description here

最佳答案

我怀疑这意味着它已被弃用。请参阅此处 more info .

Java provides a way to express deprecation because, as a class evolves, its API (application programming interface) inevitably changes: methods are renamed for consistency, new and better methods are added, and fields change. But such changes introduce a problem. You need to keep the old API around until developers make the transition to the new one, but you don't want them to continue programming to the old API.

The ability to deprecate a class, method, or member field solves the problem.

我建议使用 Joda-Time相反(相对于此处其他发帖者提出的建议),因为未弃用的 Date/Calendar 内容使用起来非常痛苦(非直观的 api ,可变,线程不安全)

关于java - 为什么在新日期的代码中使用linethrough,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12978995/

相关文章:

java - 后期绑定(bind)?领域与属性(property)。 self 与静态

java - maven - 构建一个项目而不显式构建另一个(依赖)项目

java - Netbeans - 错误 : Could not find or load main class

java:如何调整包含图像的框架的大小

c - NetBeans (7.3.1) 检测到 C 中的虚假错误

java - HttpTransportSE .call() 方法没有任何 Action

java - Android - SwitchCompat 禁用/停止默认行为

java - 如何使用PDFBox删除PDF文件中的注释

java - Log4j Fileappender 不会在它应该创建的位置创建文件

java - 使用 exe4j 创建 exe 文件时生成错误文本文件