Well, they only need to be castable to the same type without loss if data, i.e. implicitly castable, which includes subclasses. But you can not write

? true : 1
? "hello" : 'w' //note that one of them is a String, and the other is a char (character).
And so on.

But why go into the complex when we are just describing the basics, implicitly castable is one of the things beginners usually have problems with.


And I think ?: is less OS dependent then +, which I believe is processor dependent and behaves exactly the same for all processors.