Do strings use .equals or ==?

Generally . equals is used for Object comparison , where you want to verify if two Objects have an identical value. == for reference comparison (are the two Objects the same Object on the heap) & to check if the Object is null.20 Nis 2009

Sizin İçin Seçtik  What is the difference between equals and compareTo in Java?

Leave a Reply

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