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. excellent for a beginer in inet address ...
View Tutorial          By: Tony at 2009-08-13 22:39:48

2. import java.io.*;
import java.util.*;

View Tutorial          By: srikanth at 2014-05-30 06:44:58

3. hi am new to java! i need some simple java program
View Tutorial          By: Anu at 2010-09-08 08:17:49

4. Thanks for this article. Now I can understand Iter
View Tutorial          By: Rajesh Kumar at 2010-12-14 03:27:25

5. my query is like this: " accept a string, cou
View Tutorial          By: samtopper at 2014-07-31 17:40:25

6. Thanks a lot man with the server -side code.
View Tutorial          By: bot at 2011-12-03 15:04:28

7. its so nice
View Tutorial          By: senthilkumar at 2010-11-11 02:44:37

8. When copying this code into my java IDE, should i
View Tutorial          By: Barabas at 2010-02-11 03:57:09

9. how to write an byte array containing 10 different
View Tutorial          By: sanjana at 2015-01-17 06:32:41

10. plz give me for css coding
View Tutorial          By: anil mani at 2008-04-19 01:20:06