aspose file tools*
The moose likes Beginning Java and the fly likes Usage of :-    int comapareTo(float f) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Usage of :-    int comapareTo(float f)" Watch "Usage of :-    int comapareTo(float f)" New topic
Author

Usage of :- int comapareTo(float f)

Kapil Sachdeva
Greenhorn

Joined: Nov 07, 2000
Posts: 18
Can u please tell me the usage of int compareTo(float f) method defined in java.lang.Float. Please give some code lines.
Art Metzer
Ranch Hand

Joined: Oct 31, 2000
Posts: 241
To compare primitives, you can use less-than and greater-than signs.
To compare the values that the wrapper classes contain, you need to use compareTo().

returns:

HTH
Art
Manfred Leonhardt
Ranch Hand

Joined: Jan 09, 2001
Posts: 1492
Hi,
I can give you the example show below.

The compareTo method is useful when dealing with extremes. That is POSITIVE_INFINITY, NEGATIVE_INFINITY, NAN, +/-0.0f.
Regards,
Manfred.
Kapil Sachdeva
Greenhorn

Joined: Nov 07, 2000
Posts: 18
Thanks to both of u
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Usage of :- int comapareTo(float f)
 
Similar Threads
a question
Changes in the out put
Question from mock exam
type casting
decimal part of a float