转载:https://blog.csdn.net/qq_38190185/article/details/80989983?utm_medium=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromMachineLearnPai2-1.control&depth_1-utm_source=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromMachineLearnPai2-1.control
a.equals(b):如果此时a为null,则在程序运行的时候,会发生空指针异常
Objects.equals(a,b):如果两个参数都为 null, Objects.equals(a,b) 调用将返回 true ;
如果其中一个参数为 null ,则返回 false ;
否则,如果两个参数都不为 null, 则调用 a.equals(b)