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. ma'am aiza teaches us very well.. >< i like
View Tutorial          By: chai at 2011-02-07 07:06:36

2. The actual code to write F2 is:
f2.write(bu

View Tutorial          By: João at 2012-04-11 19:22:14

3. Thank you. It is very good.
View Tutorial          By: tapes pra at 2011-12-08 09:23:31

4. class Factorial
{
int fact(int

View Tutorial          By: soph at 2013-02-06 06:49:07

5. very helpful to me.thanks.very very useful to me.
View Tutorial          By: viji at 2007-12-21 03:17:14

6. cool.
View Tutorial          By: Fahad Palomo at 2011-08-03 06:19:56

7. good one
View Tutorial          By: yogesh at 2010-07-24 21:18:24

8. this tutorial example of inheritence is taken from
View Tutorial          By: vinod kumar gaur at 2011-07-17 23:18:00

9. i WROTE A FILE READER LIKE IT WAS IN THE SAMPLE BU
View Tutorial          By: LILI at 2011-11-06 01:47:20

10. Hi all
I connected my mobile wi

View Tutorial          By: sruthy at 2010-07-07 03:44:27