【发布时间】:2017-09-20 18:35:36
【问题描述】:
根据Precedence and order of evaluation left 将在 right 之前进行评估。但是,我有一个项目:
int[] df = null; //GetDataFrame()
int xIndex = 12; //GetLearningIndex()
df[0] = 1 % GetLearningIndex();
我意识到,当 GetDataFrame 返回 null 并且 GetLearningIndex 返回零时,我会得到一个 System.DivideByZeroException 我希望根据类似System.NullReferenceException ...有什么理由吗??
【问题讨论】:
标签: c# operators operator-precedence