2007年10月15日月曜日

キャスト

拡張変換
byte → short → int → long → float → double のような変換はキャスト不要

int intValue = 27;
double doubleValue = intValue

縮小変換
double doubleValue = 27.0;
int intValue = (int)doubleValue;

0 件のコメント: