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



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. Hi...Really nice post..But i got the error like
View Tutorial          By: Nithya at 2013-04-11 09:37:50

2. hi sir
im a student of aitm im doing speec

View Tutorial          By: sinan ahmed at 2015-02-09 05:45:49

3. if time out at step 6*** Exception is occure

View Tutorial          By: Bharat at 2011-08-17 10:42:23

4. Updated example to better show Thread T2 showing t
View Tutorial          By: Sanjiv at 2013-05-25 20:26:31

5. HI your explanation is absolutely correct but I am
View Tutorial          By: Anil R. Chinchawade at 2010-07-28 02:02:01

6. Hi : Pulkit Malviya .I think that book has coding
View Tutorial          By: Anand at 2012-11-04 14:13:50

7. Excellent example! Thanks a ton:-)
One ques

View Tutorial          By: Andrew at 2009-04-11 09:15:19

8. NICE EXPLANATION >>>THANK UUUUUU
View Tutorial          By: PraVeen at 2012-07-05 10:12:25

9. Sir your example is god
but i am surprisin

View Tutorial          By: Ata Ul Nasar at 2011-06-05 16:23:09

10. I like this tutorial, it is self explaining. good
View Tutorial          By: Nikia at 2013-01-25 20:04:30