One of the options in the qs. "which of the foll is true" says (this is the answer given) "equals() provide deep comparison and == provides shallow comparison" But,actually equals() & == provide the same comparison unless overridden to do otherwise or in case of boolean & string . kindly show me the light if wrong... regds, shwe [This message has been edited by Shweta (edited October 29, 2000).]
Eric Boehme
Greenhorn
Joined: Oct 19, 2000
Posts: 3
posted
0
In the RHE book, they refer == as a shallow comparison, because it just does a memory address comparison, whereas equals() is an overidden method in a class extended from Object (the source of the equals() method), and thus does a deeper level comparison.
Eric Boehme, Co-Founder The Java Information Group<br /> <br />"Only those who dare to fail greatly can ever achieve greatly." Robert Francis Kennedy
bill bozeman
Ranch Hand
Joined: Jun 30, 2000
Posts: 1070
posted
0
Shweta, We have a naming policy here at the Ranch and your name is not a valid user name. Could you pleae re-register with a more appropriate name. Check here for more infor http://www.javaranch.com/names.jsp Thanks for your posts, Bill