A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
Win a copy of
The Mikado Method
this week in the
Agile and other Processes
forum!
JavaRanch
»
Java Forums
»
Certification
»
Programmer Certification (SCJP/OCPJP)
Author
Long.MAX_VALUE and Integer.MAX_VALUE
Fethi Altunyuva
Greenhorn
Joined: Mar 27, 2002
Posts: 2
posted
Sep 09, 2002 02:49:00
0
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
Joined: Mar 27, 2002
Posts: 2
posted
Sep 09, 2002 02:54:00
0
I am very sorry, this topic is discussed in another topic...
I apologize....
I agree. Here's the link:
http://ej-technologies/jprofiler
- if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
subject: Long.MAX_VALUE and Integer.MAX_VALUE
Similar Threads
why Integer is behaving differently ??
comparing MAX Values of Wrapper class with float and double
Confusing outputs
Wrapper(==)-Q
Wrapper-Q
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter