what size each data type can store?.. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

what size each data type can store?..

explain it plz.

16th Aug 2016, 4:26 AM
Gowtham krvz kv
Gowtham krvz kv - avatar
3 Answers
+ 7
Java's Primitive Data Types boolean: 1-bit. May take on the values true and false only. byte: 1 signed byte (two's complement). Covers values from -128 to 127. short: 2 bytes, signed (two's complement), -32,768 to 32,767 int: 4 bytes, signed (two's complement). -2,147,483,648 to 2,147,483,647. long: 8 bytes signed (two's complement). Ranges from -9,223,372,036,854,775,808 to +9,223,372,036,854,775,807. float: 4 bytes, IEEE 754. Covers a range from 1.40129846432481707e-45 to 3.40282346638528860e+38 (positive or negative). double: 8 bytes IEEE 754. Covers a range from 4.94065645841246544e-324d to 1.79769313486231570e+308d (positive or negative). char: 2 bytes, unsigned, Unicode, 0 to 65,535
16th Aug 2016, 10:55 AM
WPimpong
WPimpong - avatar
0
thanks. can a char have 2 byte?.
17th Aug 2016, 3:06 PM
Gowtham krvz kv
Gowtham krvz kv - avatar
0
Ya char can be 2 byte
18th Dec 2016, 1:10 PM
Adarsh aloz
Adarsh aloz - avatar