Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within OCPJP
Search Coderanch
Advance search
Google search
Register / Login
Forums
Register
Login
Certification
»
Programmer Certification (OCPJP)
Long.MAX_VALUE and Integer.MAX_VALUE
Fethi Altunyuva
,
Greenhorn
Sep 09, 2002 02:49:00
(0 cow)
(0 skulls)
+Pie
Number of slices to send:
Send
I could not understand why is output not same for Long and Integer classes.
Output is :
true
false
Can anybody explain thanks...
class Compare{ public static void main(String args[]) { System.out.println (compare(Long.MAX_VALUE,Long.MAX_VALUE)); System.out.println (compare(Integer.MAX_VALUE,Integer.MAX_VALUE)); } public static boolean compare(double d, float f){ return d==f; } }
Fethi Altunyuva
,
Greenhorn
Sep 09, 2002 02:54:00
(0 cow)
(0 skulls)
+Pie
Number of slices to send:
Send
I am very sorry, this topic is discussed in another topic...
I apologize....
Post by:
autobot
ice is for people that are not already cool. Chill with this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
reply
This thread has been viewed 855 times.
Similar Threads
Wrapper-Q
comparing MAX Values of Wrapper class with float and double
Confusing outputs
Wrapper(==)-Q
why Integer is behaving differently ??
More...
All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 06:55:53
.