做题目偶尔遇到又忘了如何转换,特写篇博客记录一下,到时候把所有偏门一点的类型转换全部统写一下。
long -> int | long x = 10; int y = (int) x;
Long -> Integer | Long x = (long) 10; Integer y = x.intValue();
int -> long | int x = 10 ; long y = (long) x;
Integer -> Long | Integer x = 10; Long y = x.longValue();