aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes when i use float gg =10f;// flaot  gg = 10; Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "when i use float gg =10f;// flaot  gg = 10;" Watch "when i use float gg =10f;// flaot  gg = 10;" New topic
Author

when i use float gg =10f;// flaot gg = 10;

giribabu rosi
Greenhorn

Joined: Apr 14, 2005
Posts: 17
tell me?
Tom Johnson
Ranch Hand

Joined: May 11, 2005
Posts: 142
Default for floating point numbers is double so to put data into a float u have to explicitly tell compiler this.
However its not needed it the value you're putting in is same size or smaller than float.



myFloat1 explicitly indicated as a float, without it there is a compile error as double 190.245, the default without the f suffix, wont fit into float

//tom


<a href="http://faq.javaranch.com/java/UseCodeTags" target="_blank" rel="nofollow">Use Code Tags!!</a>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: when i use float gg =10f;// flaot gg = 10;
 
Similar Threads
JTable(!!!)
question about the class declaration.
can you fix "my posts" please
Jscript - java and authorizenet
Difference between Hibernate and JPA