Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

wRAPPER CLASS fLOAT

 
NAMRA3
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
tHE QUESTION IS :

public class Test {
public static void main(String args[]){
System.out.println("The value is :" + Float.POSITIVE_INFINITY==Float.NEGATIVE_INFINITY);
}
}
What will be the result ? True or false ?
 
Manfred Leonhardt
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
The result will be false, using the logic we call COMMON SENSE.
The values POSITIVE_INFINITY and NEGATIVE_INFINITY are the farthest apart values known to humans ...
Regards,
Manfred
 
Jane Griscti
Ranch Hand
Posts: 3141
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Namra3,
Please read the JavaRanch Name Policy and re-register using a name that complies with the rules.
Thanks for your cooperation.
------------------
Jane Griscti
Sun Certified Programmer for the Java� 2 Platform
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic