+ 3
Working with unary minus op.
hey guys, which way is this evaluated please? // unary minus operators int i= 5,j=2,k=3; int l = i * - (j+k); //l = 5-*5 is this evaluated right to left? // or. left to right 5*-5? System.out.println(l); //-25
2 Respuestas
+ 2
left to right, also 5-*5 wouldnt make any sense and even is wrong syntax.
+ 1
It helps to draw the evaluation tree which looks like
*
/ \
i -
\
+
/ \
j k