This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes puzzle about equals Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "puzzle about equals" Watch "puzzle about equals" New topic
Author

puzzle about equals

pamela lee
Greenhorn

Joined: Jul 01, 2002
Posts: 14
Integer i= new Integer(4);
if i use i.equals(4),what process will do?
Valentin Crettaz
Gold Digger
Sheriff

Joined: Aug 26, 2001
Posts: 7610
i.equals(4) will not compile because the equals method only accepts Objects and not primitive values.


SCJP 5, SCJD, SCBCD, SCWCD, SCDJWS, IBM XML
[Blog] [Blogroll] [My Reviews] My Linked In
 
GeeCON Prague 2014
 
subject: puzzle about equals