+ 1

Please what's the difference between pre increment and post increment in Java.

++x and x++

18th Jul 2019, 7:03 PM
Titilayomi Ajetomobi
Titilayomi Ajetomobi - avatar
2 Answers
+ 3
int a = 1; System.out.println(a); System.out.println(++a); System.out.println(a); int b = 1; System.out.println(b); System.out.println(b++); System.out.println(b); run this and you'll see it... This question was already asked alot, try to first use the search-bar... 😅 Happy coding!
18th Jul 2019, 7:08 PM
Anton Böhler
Anton Böhler - avatar
+ 1
Thanks
18th Jul 2019, 7:30 PM
Titilayomi Ajetomobi
Titilayomi Ajetomobi - avatar