The method getYear() from the type Date is deprecated
2016-07-08 16:47
826 查看
Date date =new Date();
date.getYear();方法已过期
从 JDK 1.1 开始,由 Calendar.get(Calendar.YEAR) - 1900 取代。
Calendar c = Calendar.getInstance();
c.get(Calendar.YEAR);
与date.getMonth()一样,c.get(Calendar.MONTH)也需要加1。
date.getYear();方法已过期
从 JDK 1.1 开始,由 Calendar.get(Calendar.YEAR) - 1900 取代。
Calendar c = Calendar.getInstance();
c.get(Calendar.YEAR);
与date.getMonth()一样,c.get(Calendar.MONTH)也需要加1。
相关文章推荐
- springmvc 复杂参数LIst<T> JSON参数绑定
- eclipse svn设置忽略文件
- margin 负值 理论
- C#学习篇(六)枚举
- C++继承类和基类之间成员函数和虚函数调用机制
- GTID:跳过错误
- jsonp
- poj2580 Super Memmo
- Google语音搜索在无网络下进入,不断弹出无网络的toast,按返回键无效
- js正则验证
- poj2580 Super Memmo
- rpm源码安装mysql
- 《Javascript高级程序设计》的一些可疑点
- [Sciter] Script与Native交互
- cdev_init和register_chrdev区别
- phpstorm一个窗口打开多个项目
- 【SpringMVC学习03】SpringMVC中注解和非注解方式下的映射器和适配器总结
- 关于spring在程序中读取properties文件配置项的方法
- [iOS]wallet开发demo
- 布莱叶盲文