I am not able to understand a particular explanation of the + operator. Can some one provide example to throw light on this?
For a + expression with two operands of primitive numeric type, the result has a value calculated by promoting the operands to the result type and then performing the addition using that type. This might result in overflow or loss of precision.
I wonder if the question was about "promoting the operands to the result type". See if this example makes sense:
I think these show your statement was possibly misleading. The operands are not promoted to the declared type of the result variable but to the widest operand which becomes the actual result of the expression.
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi