Comment on Tutorial - float vs double data types in Java By Baski



Comment Added by : rangzen

Comment Added at : 2014-03-28 09:31:47

Comment on Tutorial : float vs double data types in Java By Baski
"For example, float can be useful when representing dollars and cents."

No.

Check "Learning the Java Language / Language Basics / Primitive Data Types" : "This data type should never be used for precise values, such as currency. For that, you will need to use the java.math.BigDecimal class instead."


View Tutorial



Subscribe to Tutorials

Related Tutorials

Program using concept of byte long short and int in java

Update contents of a file within a jar file

Tomcat and httpd configured in port 8080 and 80

Java File

Java String

Count number of vowels, consonants and digits in a String in Java

Reverse a number in Java

Student marks calculation program in Java

Handling Fractions in Java

Calculate gross salary in Java

Calculate average sale of the week in Java

Vector in Java - Sample Program

MultiLevel Inheritance sample in Java

Multiple Inheritance sample in Java

Java program using Method Overriding

Archived Comments

1. yes 29 you are correct! 27's example is prone to a
View Tutorial          By: sameendra at 2011-07-24 11:55:54

2. Hi ,
please i need j2me appliacation :

View Tutorial          By: youyou92 at 2014-12-01 18:20:52

3. My teacher doesnt teach me right!
View Tutorial          By: Anon at 2009-02-20 07:16:08

4. The coding which is given is easy to understand bu
View Tutorial          By: Chandra Sekhar Bodireddy at 2013-03-08 06:02:17

5. Its Very Good Example
View Tutorial          By: Madhu at 2011-08-26 12:11:49

6. Good work!

Few changes: polish oper

View Tutorial          By: Karol Z. at 2010-06-02 09:09:52

7. The SAX Parser code has a problem for files of gre
View Tutorial          By: Mark Nelson at 2011-11-14 20:16:41

8. u said that const function cant change object.can
View Tutorial          By: z at 2010-05-09 12:02:17

9. Hi Andrew,

I have a java applicatio

View Tutorial          By: kumar at 2010-10-06 10:42:55

10. Actually, looking at the code, it looks as somethi
View Tutorial          By: Johnson at 2009-07-28 08:14:38