Skip to content

Commit 2c7b5e2

Browse files
committed
Precedence exercise
1 parent 7b894f8 commit 2c7b5e2

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

ch05/Precedence.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
public class Precedence
2+
{
3+
public static void main(String[] args)
4+
{
5+
int sum = 32 - 8 + 16 * 2;
6+
System.out.println("Default order: " + sum);
7+
8+
sum = (32 - 8 + 16) * 2;
9+
System.out.println("Specified order: " + sum);
10+
11+
sum = (32 -(8 + 16)) * 2;
12+
System.out.println("Nested specific order: " + sum);
13+
}
14+
}

0 commit comments

Comments
 (0)