File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes equals and  == Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "equals and  ==" Watch "equals and  ==" New topic

equals and ==

Raj Puri
Ranch Hand

Joined: Apr 24, 2003
Posts: 189
If a1.equal(a2) return true will that mean a1 == a2. If a1 and a2 are objects.
Kaz Yosh
Ranch Hand

Joined: May 22, 2003
Posts: 63
No, equals doesnt guarantee that two instances have references pointed to the same objct.

"If anything can go wrong, it will"
La Vish
Ranch Hand

Joined: Apr 17, 2002
Posts: 161
This has been discussed many times before.You can use the search facility above.Just type in equals and == and you will get all the discussions on this thread.
[ June 01, 2003: Message edited by: La Vish ]

La Vish
SCJP 1.4, President 60s Club
Francis Siu
Ranch Hand

Joined: Jan 04, 2003
Posts: 867
hi Rajesh
here and here
If you are still confused,please feel free to reply

Francis Siu
I agree. Here's the link:
subject: equals and ==
It's not a secret anymore!