Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
Yes, it's a sort of "if" statement called the "ternary operator". The part before the "?" is the condition, and the parts before and after the ":" are the true and false results, respectively. Both results have to produce a value and they have to be type-compatible. The whole expression says "if value is null, use ""; else use value.toString()."
You will find that operator called the ternary operator (because it has three operands) or the conditional operator; I have googled and found a few links which appear useful: 1 (but the () quoted are not an essential part of the operator) 2 and there are bound to be many others.
Originally posted by Ernest Friedman-Hill: Incidentally: you ought never write this snippet in real code, because there's a standard method that does exactly this: the static method String.valueOf():
In fact, it doesn't produce the same result...
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus