sequence point concept in java

后端 未结 2 510
栀梦
栀梦 2020-12-06 02:25

I am new to Java and have background of C.I am going through Khalid Moughal\'s book. On page 126 he gives an example as

   int i = 10;

   int k = ++i + --i         


        
2条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-06 02:50

    My question is does the same sequence point rule applies in java or not?

    No, there are no sequence-points in Java. Order of evaluation (etc) is well defined in Java.

    Also read this answer.

提交回复
热议问题