Development
JAVA|Error - Incompatible operand types Integer and int
어느가을빛
2010. 2. 3. 12:39
JDK 1.5 에서는 Autoboxing 기능이 추가됐다.
Object와 primitive type 간에 형변환이 자동이다.
- Incompatible operand types Boolean and boolean
- Incompatible operand types Integer and int.
<오류발생> : Incompatible operand types Integer and int.
if (ds.getColumnAsInteger(i, "SELE_CHEK") == 1) {
<해결방안> : JDK 1.4에서는 Autoboxing 기능이 없어서 명시적 변환 필요.
if (ds.getColumnAsInteger(i, "SELE_CHEK").intValue() == 1) {