We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 53713ee commit ec914d6Copy full SHA for ec914d6
1 file changed
pitfalls/Associativity.java
@@ -1,19 +1,15 @@
1
-package com.zetcode;
+void main(String[] args) {
2
3
-public class Associativity {
+ // left-to-right associativity
4
+ int val = 9 / 3 * 3;
5
- public static void main(String[] args) {
6
+ IO.println(val);
7
- // left-to-right associativity
8
- int val = 9 / 3 * 3;
+ int val2 = 0;
9
10
- System.out.println(val);
+ // right-to-left associativity
11
+ val2 *= 3 + 1;
12
- int val2 = 0;
13
-
14
- // right-to-left associativity
15
- val2 *= 3 + 1;
16
17
- System.out.println(val2);
18
- }
+ IO.println(val2);
19
}
+
0 commit comments