View Single Post
  #2 (permalink)  
Old 11-16-2007, 12:18 AM
hardwired hardwired is offline
Senior Member
 
Join Date: Jul 2007
Posts: 1,222
hardwired is on a distinguished road
The default in java is that a primitive with a decimal in it is a double. For the lower precision float type we need to specify with a trailing "F", "f" or cast the value to float.
Same applies with int and long types using "L", "l" or long cast.
See paragraph 3 under the Literals header on Primitive Data Types.
Reply With Quote