Best way to compare 2 strings

Since equals is a built in method in java , we need to make sure that it should be called with object not with null. so in case if we call with null then we will endup with Null pointer exception. Ex : assume i need to check whether string a is equal to “hai” […]

Share this article on