Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

i++ unary operator

 
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

}
};
 
Leverager of our synergies
Posts: 10065
  • Mark post as helpful
  • send pies
  • Report post to moderator
This question is being answered here.
 
Time is the best teacher, but unfortunately, it kills all of its students - Robin Williams. tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic