I hit some strange String concatenation syntax when writing some code and was surprised to find that it compiles.
quota.setText("Cloud storage: " + used + " (" + + + + quotaUsed / quotaAvailable * 100 + " of " + total);
The strange part is around the four continuous + operators (I was going to place more strings between them, and I was surprised there were no red squiggly lines underneath them. quotaUsed and quotaAvailable are longs and used and total are Strings.
Can anyone explain how the system will interpret that statement?
++operator once and the unary+operator once (making the value positive) and applying concatenation. I am not sure and would need to see output to know.++operator cannot have a space in the middle of it.+does not "make a value positive". Ifxis negative,+xis still negative.Math.abs(x)would make it positive.