Difference between prefix and postfix forms of the
++operator?

Answers were Sorted based on User's Feedback



Difference between prefix and postfix forms of the ++operator?..

Answer / ranganathkini

The prefix ++ operator first increments the value by one and
then returns the new value.

The postfix ++ operator first returns the value and then
increments it.

Is This Answer Correct ?    36 Yes 1 No

Difference between prefix and postfix forms of the ++operator?..

Answer / ravikiran

prefix will increment first and assigns to the variable
postfix will assing the value to the variable and then
increments

Is This Answer Correct ?    21 Yes 1 No

Difference between prefix and postfix forms of the ++operator?..

Answer / uday ray

They behave differently when they are used in expressions on
the right hand side of an assignment statement. A prefix
operator first adds 1 to the operand and the result is
assigned to the variable on left. On the other hand, a post
fix operator first assign the value to the variable on left
and then increments the operands.

Is This Answer Correct ?    5 Yes 2 No

Post New Answer

More Core Java Interview Questions

What are peerless components?

1 Answers  


What is lazy activation?

2 Answers   CMC,


What is the need of "creating and throwing an UserdefinedException" when the "Exception" class is already available?

4 Answers  


What is connection class in java?

1 Answers  


Can we increase size of array?

1 Answers  


What is the difference between a Window and a Frame?

6 Answers   Infosys, ProKarma,


y cant i declare method like public final static show()

3 Answers  


Explain about static imports in java?

1 Answers  


What is the difference between throw and throws?

11 Answers   IBM,


What is difference between hashset and hashmap in java?

1 Answers  


What do you understand by garbage collection in Java? Can it be forced to run?

1 Answers   TCS,


How to display arraylist values in java?

1 Answers  


Categories