如果其中一个转换是扩展转换,反向转换便是缩小转换。
If one of these conversions is widening, the reverse conversion might be narrowing.
缩小转换的范例是转换64位元带正负号的整数为32位元带正负号的整数。
An example of a narrowing conversion is converting a 64-bit signed integer to a 32-bit signed integer.
调用过程时使用扩大到对应参数类型的变量,从参数到变量的转换则为缩小转换。
A procedure is called with an argument that widens to the corresponding parameter type, and the conversion from the parameter to the argument is narrowing.
得到的对象引用使用PortableRemoteObject . narrow缩小转换为ejbHome接口。
The object reference received is narrowed to the EJB home interface using PortableRemoteObject.narrow .
同样地,当造型成一种较小的类型时,必须留意“缩小转换”的后果。否则会在造型过程中不知不觉地丢失信息。
Again, you must be aware of the effect of a narrowing conversion when casting to a smaller type, otherwise you might unknowingly lose information during the cast.
型别转换可以是「扩展」或「缩小」:扩展转换从不会溢位,而且一定成功,但是缩小转换却可能造成资讯遗失,甚至失败。
Type conversions may either be widening or narrowing: widening conversions never overflow and always succeed, whereas narrowing conversions entail the possible loss of information and may fail.
型别转换可以是「扩展」或「缩小」:扩展转换从不会溢位,而且一定成功,但是缩小转换却可能造成资讯遗失,甚至失败。
Type conversions may either be widening or narrowing: widening conversions never overflow and always succeed, whereas narrowing conversions entail the possible loss of information and may fail.
应用推荐