Pergunta de entrevista da empresa Rakuten

What is the difference between "==" and .equals in Java?

Respostas da entrevista

Sigiloso

4 de ago. de 2017

Main difference between == andequals in Java is that "==" is used to compare primitives while equals() method is recommended to check equality of objects. String comparison is a common scenario of using both ==and equals method.

Sigiloso

18 de jan. de 2018

== check if reference are equal, Equals check content of object if equal or not