Answers for "when to use i++ and ++i java"

3

++i vs i++ java

int a = 0;
int b = a++; // b = 0; a = 1

a = 0;
b = ++a: // b = 1; a = 1
Posted by: Guest on November-25-2020
3

++i vs i++ java

int i = 3;
int a = i++; // a = 3, i = 4
int b = ++a; // b = 4, a = 4
Posted by: Guest on November-25-2020

Code answers related to "when to use i++ and ++i java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language