permaculture playing cards*
The moose likes Beginning Java and the fly likes Simple Doubt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Simple Doubt" Watch "Simple Doubt" New topic

Simple Doubt

Mahesh Subramaniya

Joined: Dec 12, 2004
Posts: 19

why is the output of "i" of the following snippet is 0 and not 1

int i = 0;
i = i++

Does the expression gets evaluvated from left to right?

Mahesh Subramaniya

Christophe Verré

Joined: Nov 24, 2005
Posts: 14687

This question comes often
It's in the FAQ:

[My Blog]
All roads lead to JavaRanch
It is sorta covered in the JavaRanch Style Guide.
subject: Simple Doubt
Similar Threads
display error
need help?
column heading dates ...
how to combine between two arraylist if has same value
Declare an Array?