public class OperatorPrecedenceExample {
public static void main(String[] args) {
int a = 5, b = 6, c=10, d=2;
double result;
result = a+d*c%++b;
/*
= a+((d*c)%(b+1))
= 5 +((20)% (7))
= 5+6 = 11
*/
System.out.println(result);
} //end main
} //end class
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment