This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Dan's question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Dan Watch "Dan New topic
Author

Dan's question

Don Bosco
Ranch Hand

Joined: Oct 31, 2002
Posts: 108
int i = 0;
i = i++;
i = i++;
System.out.println("i = " +i);
I was expecting i=2. But the output is 0???


SCJP 1.4<p>Wingardium Leviosa!!
Valentin Crettaz
Gold Digger
Sheriff

Joined: Aug 26, 2001
Posts: 7610
Please see the following discussions which deals with the same topic:
http://www.coderanch.com/t/190825/java-programmer-SCJP/certification/Array
http://www.coderanch.com/t/239576/java-programmer-SCJP/certification/result
http://www.coderanch.com/t/239779/java-programmer-SCJP/certification/Easy-but-Tricky-count


SCJP 5, SCJD, SCBCD, SCWCD, SCDJWS, IBM XML
[Blog] [Blogroll] [My Reviews] My Linked In
Don Bosco
Ranch Hand

Joined: Oct 31, 2002
Posts: 108
That was a great explanation by Maha Anna!!!
Thanks to u guys.
 
jQuery in Action, 2nd edition
 
subject: Dan's question
 
Similar Threads
display error
need help?
column heading dates ...
how to combine between two arraylist if has same value
Declare an Array?