
Asked in Cognizant
What is the difference between == and .equals() in Java?

AnswerBot
4mo
In Java, '==' checks reference equality, while '.equals()' checks value equality for objects.
== compares memory addresses for reference types.
Example: String a = new String("test"); String b = new Str...read more
Help your peers!
Add answer anonymously...
Top Java Developer Interview Questions Asked at Cognizant
Q. What are the differences between JDK, JVM, and JRE?
Q. What are the main features of Java?
Q. What is the difference between == and .equals() in Java?
Interview Questions Asked to Java Developer at Other Companies
Top Skill-Based Questions for Cognizant Java Developer
Java Interview Questions and Answers
250 Questions
Data Structures Interview Questions and Answers
250 Questions
Web Development Interview Questions and Answers
250 Questions
Algorithms Interview Questions and Answers
250 Questions
Software Development Interview Questions and Answers
250 Questions
Spring Boot Interview Questions and Answers
50 Questions
Stay ahead in your career. Get AmbitionBox app


Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+
Reviews
10L+
Interviews
4 Cr+
Salaries
1.5 Cr+
Users
Contribute to help millions
AmbitionBox Awards
Get AmbitionBox app

