概述
我需要知道如何修复这些错误说明:
Note: Summer.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
这是我的代码:
import java.util.Calendar;
import java.util.*;
class Summer
{
public static void main(String[] args)
{
Date d1 = new Date();
Date j21 = new Date(d1.getYear(),6,21);
if(d1.before(j21)) {
long diff = j21.getTime() - d1.getTime();
diff = diff / (1000 * 60 * 60 * 24);
System.out.println("There are " + diff + " days until June 21st" );
}
else {
long diff = d1.getTime() - j21.getTime();
diff = diff / (1000 * 60 * 60 * 24);
diff = 365 - diff;
System.out.println("There are " + diff + " days until June 21st" );
}
}
}
最后
以上就是健康河马为你收集整理的java 编译 xlint_java – 使用-Xlint重新编译:弃用以获取详细信息的全部内容,希望文章能够帮你解决java 编译 xlint_java – 使用-Xlint重新编译:弃用以获取详细信息所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复