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 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 "equals" Watch "equals" New topic


meena latha
Ranch Hand

Joined: Jan 24, 2005
Posts: 219

not equal
Can anybody explain me why it is showing different output.
[ February 18, 2005: Message edited by: Mark Spritzler ]
Mark Spritzler

Joined: Feb 05, 2001
Posts: 17276

First, there is a button underneath the Add Reply button that will put CODE tags around code so that they don't lose their formatting and make it difficult to read.

OK, first what is the MAX_VALUE of double and float? and can you compare that to each other.

Second what about how Java handles comparison of two different primitive types, does it cast up or down, and how does it do it such that the result you see comes out "True"

Good Luck


Perfect World Programming, LLC - iOS Apps
How to Ask Questions the Smart Way FAQ
Joyce Lee
Ranch Hand

Joined: Jul 11, 2003
Posts: 1392
Have a look at some of the past threads for explanation.
I agree. Here's the link:
subject: equals
It's not a secret anymore!