Can anyone help me on this topic because i am not able to figure out when we can get these fields into use practically?
Alexandru Gifei wrote:We can use Integer.MAX_VALUE when we want to get the lowest number from an array of integers. Same logic can be applied for maximum number and for floats too.
Alexandru Gifei wrote:The Float.MIN_VALUE and .MAX_VALUE are used in the java.awt.font.TextLine class. So it seems the the developers that worked to create the JDK, reused the values.
Winston Gutkowski wrote:
I never said they can't be used; I just said you need to be careful - ie, you need to understand what they mean - if you look at java.lang.Float, you'll see that it has TWO constants with "MIN" in the name, and both of them are greater than 0.
Henry Wong wrote:If they were, then the MIN_VALUE would have been NEGATIVE_INFINITY, and the MAX_VALUE would have been POSITIVE_INFINITY -- which are the smallest and largest possible values respectively.
Winston Gutkowski wrote:
Alexandru Gifei wrote:The Float.MIN_VALUE and .MAX_VALUE are used in the java.awt.font.TextLine class. So it seems the the developers that worked to create the JDK, reused the values.
I never said they can't be used; I just said you need to be careful - ie, you need to understand what they mean - if you look at java.lang.Float, you'll see that it has TWO constants with "MIN" in the name, and both of them are greater than 0.
Winston
Pawel Pawlowicz wrote:You are wrong . The class java.lang.Float has THREE constants with "MIN" in the name: