Re: How to Tell Which Class an Object Is



Thomas Hawtin wrote:
To check I just ran the following over the latest Java SE 6 snapshot:

find /mnt/small/mustang/b53/ -name "*.java" -exec grep -h \\.class {} \; | grep if

There were some clusters of using .equals(), but by far and away the winner was ==.

And did you make sure to differentiate its use on primitives (for which ..equals() isn't possible) and its use on object references?


--
Darryl L. Pierce <mcpierce@xxxxxxxxx>
Homepage: http://mcpierce.multiply.com/
"Bury me next to my wife. Nothing too fancy..." - Ulysses S. Grant
.


Quantcast