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 is the basic concept of java?
i don't want fullforms of JDK an JVM i want definitions for them
What is meant by JVM? Is JVM platform independent or not?
How to declare an arraylist in java?
Is void a data type in java?
Suppose i have two threads t1 and t2 are running.How the main thread will know that the two threads t1,t2 execution has completed?
Can I learn java without any programming experience?
What are the differences between processes and threads?
what is collections in java?
what is meant by Byte code concept in Java?
Can we increase size of array?
Why Java is not pure Object Oriented language?