Turkish_Junky
New Member
This program is given as a question to find out the output.
I want to understand the precedence of operators over each other, if it's left to right calculation or right to left. \[code\]public class Calcualtion { public static void main(String[] args) { int a = 5, b = 7; int c = a += 2 * 3 + b--; System.out.println(c); }}\[/code\]Output is : 18 EDIT: Thanks a lot for the Inputs & link http://docs.oracle.com/javase/tutorial/java/nutsandbolts/operators.html
I want to understand the precedence of operators over each other, if it's left to right calculation or right to left. \[code\]public class Calcualtion { public static void main(String[] args) { int a = 5, b = 7; int c = a += 2 * 3 + b--; System.out.println(c); }}\[/code\]Output is : 18 EDIT: Thanks a lot for the Inputs & link http://docs.oracle.com/javase/tutorial/java/nutsandbolts/operators.html