1. Home >
  2. Apps >
  3. Groups >

Width in bits of double primitive type in Java is

Question asked by rengaraj in #Java on Dec 5, 2009
rengaraj
rengaraj · Dec 5, 2009
Rank C3 - EXPERT
Sir / madam,
My question is

The width in bits of double primitive type in Java is --. Select the one correct answer.

a. The width of double is platform dependent
b. 64
c. 128
d. 8

Advance Thanks,
R.Rengaraj
{Java Certification Quiz}
{On this forum my 20th Question.} Posted in: #Java
sarveshgupta
sarveshgupta · Dec 5, 2009
Rank B1 - LEADER
It is 64 bits with a range of -2^63 to 2^63 - 1

that is answer is b. 64

Am I correct?
mahesh_dahale
mahesh_dahale · Dec 5, 2009
Rank B2 - LEADER
sarveshgupta
It is 64 bits with a range of -2^63 to 2^63 - 1

that is answer is b. 64

Am I correct?
yes you are correct !!!
rengaraj
rengaraj · Dec 5, 2009
Rank C3 - EXPERT
Sir,
Thanks for your reply.
R.Rengaraj
Karshil Sheth
Karshil Sheth · Feb 11, 2020
Rank C2 - EXPERT

Its 8 bytes. [ 64 bits] As double is used to store floating point values and is used in static and constant methods. 

Divisha Madupalli
Divisha Madupalli · Feb 12, 2020
Rank C2 - EXPERT

The answer is 8 bytes in a 64-bit system. Double in Java is used for representing the decimal numbers. For double type there are or you can have at least 15-16 bits. The default value for decimals in Java is double if you don't give the specific units. Double uses 1 bit for sign, 11 bits for exponent and 52 bits for the mantissa. A value having a range within 1.2E-38 to 3.4E+38 can be assigned to float variables. 

Mohana Chandra
Mohana Chandra · Feb 14, 2020
Rank C1 - EXPERT

In java,double uses 8 bytes of memory ,which is equal to 64 bits , since 1byte=8 bits.

You must log-in or sign-up to reply to this post.

Click to Log-In or Sign-Up