where is .equals() method and how is it different from ==
operation <giving some confusing implementation> Is hashing
related to these?

Answer Posted / pavan kumar pathivada

The code by Namita works successfully but you need to make
certain changes to understand the concept.for every .equals
comparison in the code only two strings are considered
everytime i.e str and str3. Note that the hash code
functions also need to changed for str6 and str7.
anywys...great work namita...helped me a lot...thnks...

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How does arrays sort work in java?

597


How do I convert a numeric ip address like 192.18.97.39 into a hostname like java.sun.com?

598


What is contract between hashcode and equal method?

566


Can we assign integer value to char in java?

509


Can we overload final method in java?

544






How does finally block differ from finalize() method?

583


Why packages are used?

543


what happens when a thread cannot acquire a lock on an object? : Java thread

536


What is the right data type to represent a price in java?

564


Will the compiler creates a default constructor if I have a parameterized constructor in the class?

582


What is super keyword explain with example?

527


What is data member in java?

499


What Is Composition?

575


What are the benefits of operations in java?

493


What is the difference between the paint() and repaint() methods?

583