数据类型向下转换,精度丢失,可能会出现错误结果:
public class SimpleFormat { public static void main(String[] args) { int a=1111111; short b=(short)a; System.out.println(b); //输出:-3001 } }
工具类DateFormatUitls
数据类型向下转换,精度丢失,可能会出现错误结果:
public class SimpleFormat { public static void main(String[] args) { int a=1111111; short b=(short)a; System.out.println(b); //输出:-3001 } }
工具类DateFormatUitls