Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
    Bookmark Topic Watch Topic
  • New Topic

i++ unary operator

 
Shubh Bhat
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Report post to moderator
1. Why would this code print 11 and not 12?
2. Can you refer me to a good site which explain exception handling in detail? :roll:
class abc
{
public static void main ( String args [ ] ) {
int i = 10 ; // line 1
i = ++i ; // line 2
i = i++ ; // line 3
System . out . println ( i ); // line 4

}
};
 
Mapraputa Is
Leverager of our synergies
Sheriff
Posts: 10065
  • Mark post as helpful
  • send pies
  • Report post to moderator
This question is being answered here.
 
    Bookmark Topic Watch Topic
  • New Topic