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. great thanks a lottttttttttttttttt
View Tutorial          By: reshma at 2011-06-13 04:35:44

2. hmmmmmm good
View Tutorial          By: Haritha chinnu at 2012-06-30 09:37:49

3. My code:

$hex=array('C4028000','457

View Tutorial          By: Mark at 2015-02-02 14:42:56

4. I have tried that but still getting the same error
View Tutorial          By: pra at 2008-04-14 21:55:44

5. superb superb maza aggaya maza aggaya
View Tutorial          By: pramodh at 2012-04-16 05:21:54

6. It's good working very well...............
View Tutorial          By: avinash at 2013-03-07 09:38:21

7. Hi, I need the complete working code for sending a
View Tutorial          By: Unnati at 2011-07-13 05:06:06

8. Thanks a lot for sharing this solution.
View Tutorial          By: Bharath at 2012-12-18 18:32:33

9. Hi this is very clear and helpful, I would like to
View Tutorial          By: JoelC at 2012-11-06 16:23:19

10. i tried with d above code but am getting an error
View Tutorial          By: Aishwarya at 2009-04-05 04:41:17