때문에 나는 다음과 같은 동작의 내 프로젝트에서 버그를 발견했습니다왜이 Groovy Integer 비교가 false를 반환합니까?
int a = 1
Integer b = 2
assert a.class == b.class // ok, they are the same class
assert Integer.class != int.class // what?! they are different!
누군가가 왜, 어떻게이 문제를 처리하는 방법을 알고? 내가 링크 및 @Nathan 의견 @alfasin 사용 그루비 2.3.7 감사
정수는 클래스이며 int는 원시 데이터 형식입니다. –
[여기] (http://groovy-lang.org/objectorientation.html)에 대한 좋은 설명이 있습니다. – alfasin
'println (a.class)'을 평가한다면 무엇이 당신에게 나타날 것이라고 생각합니까? –