This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

post fix

 
devarshi pandya
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15495
43
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic