post pre increment decrement order in conjunction with precedence

This commit is contained in:
Xevion
2020-03-05 02:54:41 -06:00
parent 5aabd3d8dc
commit 11f01c4c0d

View File

@@ -52,6 +52,7 @@ If you find something incorrect, feel free to contribute and modify.
- [`hasNext` and `hasNextInt`](#hasnext-and-hasnextint)
- [`next` and `nextInt`](#next-and-nextint)
- [Examples with Explanations](#examples-with-explanations)
- [Post-increment and Post-decrement Order is Important](#post-increment-and-post-decrement-order-is-important)
<!-- /TOC -->
@@ -611,3 +612,15 @@ s = new Scanner("2 h j l 3 4 o p 0 9");
for(int i = 0; i++ < 5;)
out.println(s.nextInt());
```
### Post-increment and Post-decrement Order is Important
```java
public static int m(int x, int y) {
if(x == 0)
return 1;
else
return m(--x, y) * x;
}
```