== and equals the difference?

== memory address comparison is of two objects, i.e., whether the two are the same object (basic data type is a value comparison, is a comparison reference data memory address type)
the equals object is relatively, but it is divided into two different Case:

  • If you do not override the equals method, and then == is the same, more of the memory address
  • If the override, then the comparison is the value of the two objects

Guess you like

Origin www.cnblogs.com/zzfpz/p/10990403.html