This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Float and == Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Float and ==" Watch "Float and ==" New topic
Author

Float and ==

srinivas sridaragaddi
Ranch Hand

Joined: Jul 24, 2007
Posts: 225


output:
false
true
false


float by default is double so why 2 is returning false.


SCJP 5.0<br /> <br />"Skills are started with learning and mastered with improvement. Nothing is hereditary except death" BUDDHA...
Gautam Pandey
Greenhorn

Joined: Sep 21, 2007
Posts: 21
Hi ,

equals method for Wrapper classes returns true if both the value inside the wrapper classes are equal and they are of the same type(Double,Float..etc).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Float and ==
 
Similar Threads
equals method
about Float and Double
Float Confusion
equals()
About Wrapper classes.