Which is better equals or == in Java?

equals() is a method of Object class. == should be used during reference comparison . == checks if both references points to same location or not. equals() method should be used for content comparison.

Sizin İçin Seçtik  Vodafone sim kartım nerede?

Leave a Reply

Your email address will not be published. Required fields are marked *