What happen internally when the following statement is executed in java? i=i++; i=++i;

Showing Answers 1 - 9 of 9 Answers

hema

  • Dec 1st, 2006
 

It is incremented by two

  Was this answer useful?  Yes

lieni

  • Jan 16th, 2007
 

as single statements ++i  and i++  are the same only if you use
if i is 0;
a[i++]=xyz;  a[0]has the valuse xyz and i is now 1
a[++i]=xyz;  a[1] got the values xyz and i is also 1
 

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions