can anyone please solve this question..
Attachments:
Answers
Answered by
0
Explanation:
initially a is set to 5 which is incremented and becomes 6
now the first 'System.out.println' prints out '6'
the line 'a-=(a--)-(--a)' can be actually simplified to 'a=a-((a--)-(--a))'
so putting the values, a=6-(6-4)=4
since 'a--' returns the value of a and then decrements it and '--a' first decrements the value of a and then returns it.
it's kinda like this, a is 6 then a-- returns 6 and changes the value of a to 5 and the second --a changes the value of a to 4 and returns it.
Hope you understood it.
Similar questions
Physics,
21 days ago
Social Sciences,
21 days ago
Chemistry,
21 days ago
English,
8 months ago
English,
8 months ago