• Post Reply Bookmark Topic Watch Topic
  • New Topic

Float and ==  RSS feed

 
srinivas sridaragaddi
Ranch Hand
Posts: 225
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


output:
false
true
false


float by default is double so why 2 is returning false.
 
Gautam Pandey
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

equals method for Wrapper classes returns true if both the value inside the wrapper classes are equal and they are of the same type(Double,Float..etc).
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!