Differentiate –--a
and a-- in java
Answers
Answered by
5
Answer:
--a
Here -- is predecrement operator. It decrease the value of a by a after the execution.
a--
Here --is post decrement operator. It means the value of a is changed immediately I. e. one less than a
Answered by
3
Differentiate between –--a and a-- in java is given below
Explanation:
- –--a is treated like as pre decrement operator Means firstly it decrease the value by 1 then it store or assign the value to the variable .
- a-- is treated like as post decrement operator Means firstly it store or assign the value to the variable then it decrease the value by 1.
- Both a-- and --a is used in java the programming language
For example if a=8
- if we performing a= --a;
then firstly it decreases the value means a=7;// according to pre decrement
- if we performing a= a--;
firstly it assigning the value to variable a then perform operation .
Learn More :
- https://brainly.com/question/11113141
Similar questions