Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

int i = 5; i = i++; System.out.println(i); it prints 5; please explain.

807601May 20 2008 — edited May 21 2008
Hello all,

I am planning to go for SCJP can you please explain this:

inside main() i have this.

int i = 5;
i = i++;
System.out.println(i);

//it prints 5; please explain.

Thanx.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 18 2008
Added on May 20 2008
10 comments
1,290 views