Why does this statement cause an error? | Sololearn: Learn to code for FREE!
0

Why does this statement cause an error?

System.out.println (++(++i));

5th Jul 2017, 7:14 PM
Learner
Learner - avatar
3 Answers
+ 5
++i returns a constant. so the outer ++ is given an constant whereas it can only work on variables. so the error.
5th Jul 2017, 7:29 PM
Venkatesh Pitta
Venkatesh Pitta - avatar
+ 1
@Venkatesh Thanks!!!
5th Jul 2017, 7:30 PM
Learner
Learner - avatar
0
++
5th Jul 2017, 7:18 PM
AgentSmith