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

Is java a virus?

0 Answers  


How we can make copy of a java object?

0 Answers  


What is set in java?

0 Answers  


What is a singleton puppy?

0 Answers  


What is the purpose of declaring a variable as final?

0 Answers  


Is empty .java file name a valid source file name?

0 Answers  


What are strings in physics?

0 Answers  


What is an object?s lock? Give name of object?s that have locks?

2 Answers  


How do I find and replace in word?

0 Answers  


what is use of business objects?

3 Answers   Tech Mahindra,


What is compile time polymorphism?

20 Answers   CTS, Elementus Technologies, Oracle,


Using callable statement how can you pass out parameters, explain with example?

0 Answers  


Categories