What is the purpose of Java's unary plus operator?
- by Syntactic
Java's unary plus operator appears to have come over from C, via C++. As near as I can tell, it has the following effects:
promotes its operand to int, if it's not already an int or wider
unboxes its operand, if it's a wrapper object
complicates slightly the parsing of evil expressions containing large numbers of consecutive plus signs
It seems…