Quantcast
Channel: How To Do In Java » equals
Browsing latest articles
Browse All 4 View Live

Always use length() instead of equals() to check empty string in java

In your day-to-day programming activities, you must be coming across multiple situation where you need to check if a string is empty. There are various ways to do this and some use string1.equals(“”)....

View Article



How to design a good key for HashMap

A very popular interview question indeed. It is asked immediately after “How HashMap works?”. Lets make a reasoning around a good key class design. The very basic need for designing a good key is that...

View Article

Hibernate Entities Equality and Identity

Many times in our application, we face a situation where we have to compare two objects to check their equality for satisfying some business rules. In core java, we have already much knowledge about...

View Article

Working with hashCode and equals methods in java

In this post, i will point out my understanding about hashCode() and equals() methods. I will talk about their default implementation and how to correctly override them. I will also write about...

View Article
Browsing latest articles
Browse All 4 View Live


Latest Images