I am currently in Java1 this semester, and I asked my teacher a question, that he could not really answer, because he didn't really know why. Or rather couldn't think of what purpose it would serve.
Let us say that, when setting variables a=5
and b=-4
. And I wanted to know the value of a+b
set to System.out.println
.
I could do a + b
, but I could also do a + + b
, which means add a to the positive b
. Although b
is negative the positive variable is still negative 4.
However, if I change the equation to a - - b
, it should come out to b
being a positive 4.
So my question, is what is really the purpose of creating an equation for a positive variable if the positive variable, is just the variable.