llong year=1970+today/1000/60/60/24/365; System.out.println(
llong year=1970+today/1000/60/60/24/365; System.out.println(year);
为啥year不用int
用了int会报错
public class day03 {
public static void main(String[] args)
{
float a=2.6f;//2.6在内存中是二进制
float b=(float)2.6d;
char c=65;//在不超过范围的前期下可以赋值
long today=System.currentTimeMillis();//系统调用当前的毫秒从1970开始计算
System.out.println(today);//调用后要输出的才会在电脑的屏幕上边显示出来
long year=1970+today/1000/60/60/24/365;
System.out.println(year);//输出的是哪一年
}
}