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. Hi Steven. It looks like your example program does
View Tutorial          By: Ben Hallinan at 2008-04-25 08:36:42

2. Very good article on string , please also mentions
View Tutorial          By: Subham at 2014-04-29 18:01:04

3. Gracias.
View Tutorial          By: maiki at 2015-03-05 15:20:05

4. nice information, thanks dost.
View Tutorial          By: Bhargavi Menpara at 2013-02-12 08:11:23

5. nice article, many thanx :)
View Tutorial          By: Unknown at 2008-10-16 21:09:02

6. nice one
View Tutorial          By: dhusor at 2012-05-08 17:38:50

7. In the above example..where you make the GC1 objec
View Tutorial          By: prasad at 2014-12-11 11:12:28

8. i use your program to read my GPS ( in COM11 ) .
View Tutorial          By: Dinesh rajapaksha at 2009-11-17 07:25:19

9. Hi All........
People those who are ge

View Tutorial          By: Abhijit at 2013-05-28 11:24:24

10. PROGRAM TO FIND OUT SMALLER NU:-

cl

View Tutorial          By: ishaan gogna at 2012-05-09 19:00:49