Re: interpretation help of ?:



well, at least it shows very clearly why I am always trying to stay away from it as far as possible :-)

Your example shows very well how awefully complicated you can write easy things using ternary operators, just to fit them in one LOC.

/philipp

Petterson Mikael schrieb:
How shall i interpret the use of ?: operator in the code below?

cheers,

//mikael

String getGetTestCaseWriterName(MomClass momClass) {
return isMoDataPersisten(momClass)
? momClass.getName().charAt(0) <= 'N' ? GET_TEST_A_N
: GET_TEST_O_Z
: GET_TEST_CC;
}
.