|
Notices |
|
Thread Tools | Rate Thread | Display Modes |
05-31-2019, 02:07 AM | #1 |
Registered User
Join Date: Jul 2018
Posts: 8
|
What is the difference between double and float variables in Java?
In java, float takes 4 bytes in memory while Double takes 8 bytes in memory. Float is Single precision floating point decimal number, while Double is double precision decimal number.
https://www.exltech.in/java-training.html |
07-14-2019, 10:46 PM | #2 |
Registered User
Join Date: May 2015
Location: Forum
Posts: 2,517
|
Though both float and double datatype are used to represent floating point numbers in Java, a double data type is more precise than float. A double variable can provide precision up to 15 to 16 decimal points as compared to float precision of 6 to 7 decimal digits.
__________________
█ To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | $1 VPS Hosting █ To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | Windows Server with Remote Desktop Access █ To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | Servers with Free IPMI Setup |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | Rate This Thread |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
What is the default value of float and double datatype in Java? | Martinricky | Programming General | 0 | 11-10-2015 03:31 AM |