A good answer might be:

value: 11 result: 20

Use Very Carefully

The example program fragment:

int value = 10 ;
int result = 0 ;

result = value++ * 2 ;

System.out.println("value: " + value + "  result: " + result );
is equivalent to this program fragment:
int value = 10 ;
int result = 0 ;

result = value * 2 ;
value  = value + 1 ;

System.out.println("value: " + value + "  result: " + result );

The second version is one statement longer, but easier to understand. You should use the increment operator only where it makes a program clearer, not merely to save typing. It is possible to write very confusing code by using the increment operator without enough thought. Remember that it takes much more time to debug than to type!

The increment operator can only be used with a variable, not with a more complicated arithmetic expression. The following is incorrect:

int x = 15;
int result;

result = (x * 3 + 2)++  ;   // Wrong!

QUESTION 5:

(Thought question:) Would it sometimes be useful to increment the value in a variable before using it?

Click Here after you have answered the question