public class Primitive {
public static void main(String []args) {
byte x=5;
Double y=(Double)x; //Error : Cannot cast from byte to Double.
Byte n=7;
Double m=(Double)n; //Error : cannot cast from Byte to Double.
double c=n; //working right ..."double is primitive and Byte is object ".
}
}
Какой смысл предотвращать приведение Byte к Double? .. я знаю Double to Byte по соображениям точности, если я не ошибаюсь.