Comparing two objects, either of which could be null

后端 未结 4 1558
攒了一身酷
攒了一身酷 2021-01-04 19:06

I have a function in one of my classes that compares itself with another instance of the same class - and finds out which variables differ. This is for the purpose of minimi

4条回答
  •  一生所求
    2021-01-04 20:04

        if (this.myString != null && this.myString.equals(comparisonObj.myString))
    {
                    changedVars.add("myString");
    }
    

提交回复
热议问题