Question PRG-JAVA-0050
MediumWhat is the difference between == and equals() for Java objects?
- A.
== cannot be used on objects
- B.
They are the same
- C.
Sign up free to see the answer and a step-by-step explanation.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Java question
What is the difference between == and equals() for Java objects?
== cannot be used on objects
They are the same
Sign up free to see the answer and a step-by-step explanation.
== compares references; equals() compares content as defined by the class
equals() compares references