aspose file tools*
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
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: 14352
    
  22

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 8 API documentation
 
 
subject: post fix