Go Back   Site Owners Forums - Webmaster Forums > General Arena > General Discussion

Notices


Reply
 
Thread Tools Rate Thread Display Modes
Old 05-31-2019, 02:07 AM   #1
preetiagarwal
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
preetiagarwal is offline   Reply With Quote

Old 07-14-2019, 10:46 PM   #2
RH-Calvin
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
RH-Calvin is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

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


All times are GMT -7. The time now is 12:21 PM.


Powered by vBulletin Copyright © 2020 vBulletin Solutions, Inc.