This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes post fix 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 "post fix" Watch "post fix" New topic
Author

post fix

devarshi pandya
Greenhorn

Joined: May 25, 2007
Posts: 3
sir,

public class xxx{
public static void main|(String args[]){
int i=10;
i=i++;
System.out.println(i);
O/P is 10 why???
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074
    
  16

i = i++ is not what you think it is. See this: JavaRanch FAQ: Post Increment Operator And Assignment.

(Please don't post a question more than once, and choose a forum carefully. This is a beginner's question, not an Advanced Java question).


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
 
wood burning stoves
 
subject: post fix
 
Similar Threads
I THROW QUESTIONS WHO CAN CATCH , CATCH IT.
confused
explain why the following will compile
modify method in byte code using ASM.
A question about "Increment"