The difference between "==" and equals() in Java

==: Determine whether the first address of two strings in memory is the same, that is, determine whether they are the same string object

equals(): Compares the contents stored in two string objects for the same

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325111601&siteId=291194637