servicesDto.setPhotospath(values.get("photospath") == null ? null
:values.get("photospath").toString());
여기에 표시되는 내용과이 방식으로 null이 사용되는 이유는 다음과 같습니다. '== null? null '이것은 java에서 무엇을 나타 냅니까?
참고 : 나는 신선하다. 그런 언급을하고 Bro/Sis/Friends를 설명해주세요.
감사합니다 ... !!!
foo.isSomething() ? doThis() : doThat();
과 하나는 다음과 같습니다, 올바른 형식의
: 당신은 ternary operator보고있는
if(values.get("photospath") == null) {
servicesDto.setPhotospath(null);
}else {
servicesDto.setPhotospath(values.get("photospath").toString());
}
이것은 [삼항 연산자]라고합니다. (http://en.wikipedia.org/wiki/%3F :) –
@ NambiNarayanan 그는 삼항 연산자에 대해 묻고 있다고 생각합니까? – Kon
Bro Karthik에게 감사드립니다. – user3479835