Best way to write if( x != null && x != value)

前端 未结 0 843
感情败类
感情败类 2021-01-27 23:15

My current code is like this:

if(x != null) {
    if (x.getValue() != 5) {
        //do stuff
    }
}

Is there a better way to write this case? T

相关标签:
回答
  • 消灭零回复
提交回复
热议问题