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. How to draw a thick circle in midlet?
View Tutorial          By: masi at 2011-12-01 11:47:00

2. im having errors in sPort.sendBreak in SerialConne
View Tutorial          By: mrrrc at 2013-03-18 08:54:50

3. Thanks a lot......Plz help me to execute these fil
View Tutorial          By: Sanjana at 2013-01-26 10:15:12

4. the website is good and nice helps a lot add more
View Tutorial          By: wkkjnj at 2010-07-20 04:34:13

5. HI . i got the following exception while start up
View Tutorial          By: Ramesh at 2011-02-01 00:14:14

6. i appreciate the article for being straight to the
View Tutorial          By: shey-poun at 2011-12-14 06:39:51

7. excellent code.....
View Tutorial          By: Anonymous at 2009-05-07 03:09:01

8. Thanks. Your post was clear and worked perfectly a
View Tutorial          By: Suma at 2009-03-05 09:40:08

9. Hi it is working fine .but when my server we imple
View Tutorial          By: mohan at 2014-11-28 10:57:22

10. Good Example ...For Both FIleWriter and FileReader
View Tutorial          By: karthikeyan.v at 2009-11-17 02:27:42