aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Increment Operator Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Increment Operator" Watch "Increment Operator" New topic
Author

Increment Operator

Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9519
    
    2

Hi all,

The code below...



Regards,
Jothi Shankar Kumar. S


SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
Shaan Shar
Ranch Hand

Joined: Dec 27, 2005
Posts: 1249

Originally posted by Jothi Shankar Kumar Sankararaj:
Hi all,

The code below...



Regards,
Jothi Shankar Kumar. S


Dear Jothi,

This question is asked so many times in this forum, It would be great if you search in the forum for earlier thread.

Or you may even check out this one.
1. Increment operation question

2. Post Increment

Hope you find it usefull.


The Best way to predict your future is to create it - Every great individual common man
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9519
    
    2

Hi Sharma,

Thanks for the feedback. Im checking it.

Regards,
Jothi Shankar Kumar. S
Prafulla N. Patil
Ranch Hand

Joined: Mar 20, 2006
Posts: 106
if it was as
i=++i;

then it will print as 2

try to underatand diff between ++i and i++ (PreIncrement and PostIncrement)

in your case assignment is done first and then increment is done !!!1


Thanks, Prafulla Patil
SCJP, SCWCD
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Increment Operator