Difference between prefix and postfix forms of the
++operator?
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
What are field variable and local variable?
Which non-unicode letter characters may be used as the first character of an identifier?
why should we get the following error ? Exception in main method NoClassDefFoundError:classname could anyone give the detail clarification on how java compiler can look for .class file?
What are File and RandomAccessFile classes?
How to call one constructor from the other constructor ?
when to use abstract class and when to use interface?
16 Answers Exterro, iGate, IonIdea,
Explain an algorithm to find depth of a binary tree.
0 Answers Akamai Technologies,
Can we write a class without main method in java?
Which class has no duplicate elements?
What is the default value of byte datatype in java?
what is the purpose of the wait(), notify(), and notifyall() methods? : Java thread
What is ascii format?